/* mac80211 */
struct ieee80211_hw *hw;
struct ieee80211_vif *vif;
+ u8 mac_hw;
/* netdev */
struct usb_device *usb;
struct net_device *dev;
int device_alloc_frag_buf(struct vnt_private *, PSDeFragControlBlock pDeF);
void vnt_configure_filter(struct vnt_private *);
+int vnt_init(struct vnt_private *priv);
#endif
if (ieee80211_register_hw(priv->hw))
return -ENODEV;
+ priv->mac_hw = true;
+
return 0;
}
usb_device_reset(priv);
+ MP_CLEAR_FLAG(priv, fMP_DISCONNECTED);
+ vResetCommandTimer(priv);
+
+ bScheduleCommand(priv, WLAN_CMD_INIT_MAC80211, NULL);
+
return 0;
err_nomem:
if (!priv)
return;
- ieee80211_unregister_hw(priv->hw);
+ if (priv->mac_hw)
+ ieee80211_unregister_hw(priv->hw);
usb_set_intfdata(intf, NULL);
usb_put_dev(interface_to_usbdev(intf));
return;
switch (pDevice->eCommandState) {
+ case WLAN_CMD_INIT_MAC80211_START:
+ if (pDevice->mac_hw)
+ break;
+
+ dev_info(&pDevice->usb->dev, "Starting mac80211\n");
+
+ if (vnt_init(pDevice)) {
+ /* If fail all ends TODO retry */
+ dev_err(&pDevice->usb->dev, "failed to start\n");
+ ieee80211_free_hw(pDevice->hw);
+ return;
+ }
+ break;
case WLAN_CMD_SCAN_START:
pDevice->byReAssocCount = 0;
pDevice->cbFreeCmdQueue++;
pDevice->bCmdRunning = true;
switch (pDevice->eCommand) {
+ case WLAN_CMD_INIT_MAC80211:
+ pDevice->eCommandState = WLAN_CMD_INIT_MAC80211_START;
+ break;
+
case WLAN_CMD_BSSID_SCAN:
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"eCommandState= WLAN_CMD_BSSID_SCAN\n");
pDevice->eCommandState = WLAN_CMD_SCAN_START;
//mike add:reset command timer
void vResetCommandTimer(struct vnt_private *pDevice)
{
- cancel_delayed_work_sync(&pDevice->run_command_work);
-
pDevice->cbFreeCmdQueue = CMD_Q_SIZE;
pDevice->uCmdDequeueIdx = 0;
pDevice->uCmdEnqueueIdx = 0;
// Command code
typedef enum tagCMD_CODE {
+ WLAN_CMD_INIT_MAC80211,
WLAN_CMD_BSSID_SCAN,
WLAN_CMD_SSID,
WLAN_CMD_DISASSOCIATE,
// Command state
typedef enum tagCMD_STATE {
+ WLAN_CMD_INIT_MAC80211_START,
WLAN_CMD_SCAN_START,
WLAN_CMD_SCAN_END,
WLAN_CMD_DISASSOCIATE_START,