Re: [patch] do not allow IPW_2100=Y or IPW_2200=Y

From: Pavel Machek
Date: Tue Jul 11 2006 - 17:43:38 EST


On Mon 2006-07-10 23:05:06, Michael Buesch wrote:
> On Monday 10 July 2006 19:53, you wrote:
> > Pavel Machek wrote:
> > > Kconfig currently allows compiling IPW_2100 and IPW_2200 into kernel
> > > (not as a module). Unfortunately, such configuration does not work,
> > > because these drivers need a firmware, and it can't be loaded by
> > > userspace loader when userspace is not running.
> >
> > False, initramfs...
>
> Does the ipw driver _really_ need the firmware on insmod time?
> bcm43xx, for example, loads the firmware on "ifconfig up" time.
> If ipw really needs the firmware on insmod, is it possible to
> defer it to later at "ifconfig up" time?

Probably not. This (very dirty) hack implements that (with some level
of success -- ifconfig down/ifconfig up is enough to get wireless
working).

Signed-off-by: Pavel Machek <pavel@xxxxxxx>

Pavel

--- clean-mm/drivers/net/wireless/ipw2200.c 2006-07-11 15:22:50.000000000 +0200
+++ linux-mm/drivers/net/wireless/ipw2200.c 2006-07-11 14:38:01.000000000 +0200
@@ -97,6 +97,7 @@
static int bt_coexist = 0;
static int hwcrypto = 0;
static int roaming = 1;
+static int needs_reinit = 1;
static const char ipw_modes[] = {
'a', 'b', 'g', '?'
};
@@ -10013,10 +10014,20 @@
sys_config->silence_threshold = 0x1e;
}

+static int ipw_pci_suspend(struct pci_dev *pdev, pm_message_t state);
+static int ipw_pci_resume(struct pci_dev *pdev);
+
static int ipw_net_open(struct net_device *dev)
{
struct ipw_priv *priv = ieee80211_priv(dev);
IPW_DEBUG_INFO("dev->open\n");
+
+ if (needs_reinit) {
+ printk("ipw: Delayed loading the firmware\n");
+ ipw_pci_suspend(priv->pci_dev, PMSG_FREEZE);
+ ipw_pci_resume(priv->pci_dev);
+ }
+
/* we should be verifying the device is ready to be opened */
mutex_lock(&priv->mutex);
if (!(priv->status & STATUS_RF_KILL_MASK) &&
@@ -11295,7 +11306,8 @@

if (ipw_up(priv)) {
mutex_unlock(&priv->mutex);
- return -EIO;
+ needs_reinit = 1;
+ return 0;
}

mutex_unlock(&priv->mutex);


--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/