From: Denis V. <vd...@il...> - 2005-11-27 15:30:37
|
On Sunday 27 November 2005 16:51, Carlos Mart=EDn wrote: > On 27/11/05, Denis Vlasenko <vd...@il...> wrote: > > > > I hope we won't need delays on "up" path. >=20 > With that it works, but if you keep doing ip l s wlan0 up; ip l s > wlan0 down over and over, it'll eventually fail. The longer the delay > in the down path, the longer it takes > for it to happen (in number of times it takes to fail). It fails with > a timeout error, which suggest that the bug is in the firmware. > Furthermore, if you unload and then reload the driver, it will still > fail. It takes a plugging the device out and back in for it to work, > effectively rebooting the device. Ok. 1000 ms is a bit drastic, let's try 20 ms (2 ticks at 100 HZ): acxusb_e_open(struct net_device *dev) { wlandevice_t *priv =3D netdev_priv(dev); unsigned long flags; int i; FN_ENTER; acx_sem_lock(priv); /* put the ACX100 out of sleep mode */ acx_s_issue_cmd(priv, ACX1xx_CMD_WAKE, NULL, 0); acx_s_issue_cmd(priv, ACX1xx_CMD_ENABLE_TX, NULL, 0); acx_s_issue_cmd(priv, ACX1xx_CMD_ENABLE_RX, NULL, 0); acx_init_task_scheduler(priv); init_timer(&priv->mgmt_timer); priv->mgmt_timer.function =3D acx_i_timer; priv->mgmt_timer.data =3D (unsigned long)priv; /* acx_s_start needs it */ SET_BIT(priv->dev_state_mask, ACX_STATE_IFACE_UP); acx_s_start(priv); /* don't acx_start_queue() here, we need to associate first */ acx_lock(priv, flags); for (i =3D 0; i < ACX_RX_URB_CNT; i++) { priv->usb_rx[i].urb->status =3D 0; acxusb_l_poll_rx(priv, &priv->usb_rx[i]); } acx_unlock(priv, flags); WLAN_MOD_INC_USE_COUNT; /* Let things settle down a little in USB and/or firmware */ acx_s_msleep(20); acx_sem_unlock(priv); FN_EXIT0; return 0; } BTW, acx_s_start does: SET_BIT(priv->set_mask, SET_TEMPLATES|SET_STA_LIST|GETSET_WEP |GETSET_TXPOWER|GETSET_ANTENNA|GETSET_ED_THRESH|GETSET_CCA |GETSET_REG_DOMAIN|GETSET_MODE|GETSET_CHANNEL |GETSET_TX|GETSET_RX); ^^^^^^^^^ ^^^^^^^^^ acxlog(L_INIT, "updating initial settings on iface activation...\n"= ); acx_s_update_card_settings(priv, 0, 0); and acx_s_update_card_settings() will do ACX1xx_CMD_ENABLE_RX/TX =3D=3D> our ENABLE_RX/TX's in acxusb_e_open() are probably superfluous and can be removed. Please test this if you have spare time. =2D- vda |