diff options
Diffstat (limited to 'drivers/staging/wlan-ng')
-rw-r--r-- | drivers/staging/wlan-ng/hfa384x_usb.c | 33 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/prism2mgmt.c | 78 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/prism2mgmt.h | 2 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/prism2sta.c | 6 |
4 files changed, 66 insertions, 53 deletions
diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c index d1e8218f96fb..197f5a914e8f 100644 --- a/drivers/staging/wlan-ng/hfa384x_usb.c +++ b/drivers/staging/wlan-ng/hfa384x_usb.c @@ -184,11 +184,11 @@ static void hfa384x_usbin_ctlx(struct hfa384x *hw, union hfa384x_usbin *usbin, static void hfa384x_usbctlxq_run(struct hfa384x *hw); -static void hfa384x_usbctlx_reqtimerfn(unsigned long data); +static void hfa384x_usbctlx_reqtimerfn(struct timer_list *t); -static void hfa384x_usbctlx_resptimerfn(unsigned long data); +static void hfa384x_usbctlx_resptimerfn(struct timer_list *t); -static void hfa384x_usb_throttlefn(unsigned long data); +static void hfa384x_usb_throttlefn(struct timer_list *t); static void hfa384x_usbctlx_completion_task(unsigned long data); @@ -558,13 +558,11 @@ void hfa384x_create(struct hfa384x *hw, struct usb_device *usb) INIT_WORK(&hw->link_bh, prism2sta_processing_defer); INIT_WORK(&hw->usb_work, hfa384x_usb_defer); - setup_timer(&hw->throttle, hfa384x_usb_throttlefn, (unsigned long)hw); + timer_setup(&hw->throttle, hfa384x_usb_throttlefn, 0); - setup_timer(&hw->resptimer, hfa384x_usbctlx_resptimerfn, - (unsigned long)hw); + timer_setup(&hw->resptimer, hfa384x_usbctlx_resptimerfn, 0); - setup_timer(&hw->reqtimer, hfa384x_usbctlx_reqtimerfn, - (unsigned long)hw); + timer_setup(&hw->reqtimer, hfa384x_usbctlx_reqtimerfn, 0); usb_init_urb(&hw->rx_urb); usb_init_urb(&hw->tx_urb); @@ -574,8 +572,7 @@ void hfa384x_create(struct hfa384x *hw, struct usb_device *usb) hw->state = HFA384x_STATE_INIT; INIT_WORK(&hw->commsqual_bh, prism2sta_commsqual_defer); - setup_timer(&hw->commsqual_timer, prism2sta_commsqual_timer, - (unsigned long)hw); + timer_setup(&hw->commsqual_timer, prism2sta_commsqual_timer, 0); } /*---------------------------------------------------------------- @@ -2460,7 +2457,7 @@ int hfa384x_drvr_start(struct hfa384x *hw) * ok */ result = - usb_get_status(hw->usb, USB_RECIP_ENDPOINT, hw->endp_in, &status); + usb_get_std_status(hw->usb, USB_RECIP_ENDPOINT, hw->endp_in, &status); if (result < 0) { netdev_err(hw->wlandev->netdev, "Cannot get bulk in endpoint status.\n"); goto done; @@ -2469,7 +2466,7 @@ int hfa384x_drvr_start(struct hfa384x *hw) netdev_err(hw->wlandev->netdev, "Failed to reset bulk in endpoint.\n"); result = - usb_get_status(hw->usb, USB_RECIP_ENDPOINT, hw->endp_out, &status); + usb_get_std_status(hw->usb, USB_RECIP_ENDPOINT, hw->endp_out, &status); if (result < 0) { netdev_err(hw->wlandev->netdev, "Cannot get bulk out endpoint status.\n"); goto done; @@ -3800,9 +3797,9 @@ delresp: * interrupt *---------------------------------------------------------------- */ -static void hfa384x_usbctlx_reqtimerfn(unsigned long data) +static void hfa384x_usbctlx_reqtimerfn(struct timer_list *t) { - struct hfa384x *hw = (struct hfa384x *)data; + struct hfa384x *hw = from_timer(hw, t, reqtimer); unsigned long flags; spin_lock_irqsave(&hw->ctlxq.lock, flags); @@ -3859,9 +3856,9 @@ static void hfa384x_usbctlx_reqtimerfn(unsigned long data) * interrupt *---------------------------------------------------------------- */ -static void hfa384x_usbctlx_resptimerfn(unsigned long data) +static void hfa384x_usbctlx_resptimerfn(struct timer_list *t) { - struct hfa384x *hw = (struct hfa384x *)data; + struct hfa384x *hw = from_timer(hw, t, resptimer); unsigned long flags; spin_lock_irqsave(&hw->ctlxq.lock, flags); @@ -3899,9 +3896,9 @@ static void hfa384x_usbctlx_resptimerfn(unsigned long data) * Interrupt *---------------------------------------------------------------- */ -static void hfa384x_usb_throttlefn(unsigned long data) +static void hfa384x_usb_throttlefn(struct timer_list *t) { - struct hfa384x *hw = (struct hfa384x *)data; + struct hfa384x *hw = from_timer(hw, t, throttle); unsigned long flags; spin_lock_irqsave(&hw->ctlxq.lock, flags); diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c index c4aa9e7e7003..72070593394a 100644 --- a/drivers/staging/wlan-ng/prism2mgmt.c +++ b/drivers/staging/wlan-ng/prism2mgmt.c @@ -394,8 +394,9 @@ int prism2mgmt_scan_results(struct wlandevice *wlandev, void *msgp) count = HFA384x_SCANRESULT_MAX; if (req->bssindex.data >= count) { - pr_debug("requested index (%d) out of range (%d)\n", - req->bssindex.data, count); + netdev_dbg(wlandev->netdev, + "requested index (%d) out of range (%d)\n", + req->bssindex.data, count); result = 2; req->resultcode.data = P80211ENUM_resultcode_invalid_parameters; goto exit; @@ -684,7 +685,8 @@ int prism2mgmt_start(struct wlandevice *wlandev, void *msgp) goto done; failed: - pr_debug("Failed to set a config option, result=%d\n", result); + netdev_dbg(wlandev->netdev, + "Failed to set a config option, result=%d\n", result); msg->resultcode.data = P80211ENUM_resultcode_invalid_parameters; done: @@ -1120,15 +1122,17 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp) /* Disable monitor mode */ result = hfa384x_cmd_monitor(hw, HFA384x_MONITOR_DISABLE); if (result) { - pr_debug("failed to disable monitor mode, result=%d\n", - result); + netdev_dbg(wlandev->netdev, + "failed to disable monitor mode, result=%d\n", + result); goto failed; } /* Disable port 0 */ result = hfa384x_drvr_disable(hw, 0); if (result) { - pr_debug - ("failed to disable port 0 after sniffing, result=%d\n", + netdev_dbg + (wlandev->netdev, + "failed to disable port 0 after sniffing, result=%d\n", result); goto failed; } @@ -1140,8 +1144,9 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp) HFA384x_RID_CNFWEPFLAGS, hw->presniff_wepflags); if (result) { - pr_debug - ("failed to restore wepflags=0x%04x, result=%d\n", + netdev_dbg + (wlandev->netdev, + "failed to restore wepflags=0x%04x, result=%d\n", hw->presniff_wepflags, result); goto failed; } @@ -1153,8 +1158,9 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp) HFA384x_RID_CNFPORTTYPE, word); if (result) { - pr_debug - ("failed to restore porttype, result=%d\n", + netdev_dbg + (wlandev->netdev, + "failed to restore porttype, result=%d\n", result); goto failed; } @@ -1162,8 +1168,9 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp) /* Enable the port */ result = hfa384x_drvr_enable(hw, 0); if (result) { - pr_debug("failed to enable port to presniff setting, result=%d\n", - result); + netdev_dbg(wlandev->netdev, + "failed to enable port to presniff setting, result=%d\n", + result); goto failed; } } else { @@ -1182,8 +1189,9 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp) HFA384x_RID_CNFPORTTYPE, &(hw->presniff_port_type)); if (result) { - pr_debug - ("failed to read porttype, result=%d\n", + netdev_dbg + (wlandev->netdev, + "failed to read porttype, result=%d\n", result); goto failed; } @@ -1192,24 +1200,27 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp) HFA384x_RID_CNFWEPFLAGS, &(hw->presniff_wepflags)); if (result) { - pr_debug - ("failed to read wepflags, result=%d\n", + netdev_dbg + (wlandev->netdev, + "failed to read wepflags, result=%d\n", result); goto failed; } hfa384x_drvr_stop(hw); result = hfa384x_drvr_start(hw); if (result) { - pr_debug("failed to restart the card for sniffing, result=%d\n", - result); + netdev_dbg(wlandev->netdev, + "failed to restart the card for sniffing, result=%d\n", + result); goto failed; } } else { /* Disable the port */ result = hfa384x_drvr_disable(hw, 0); if (result) { - pr_debug("failed to enable port for sniffing, result=%d\n", - result); + netdev_dbg(wlandev->netdev, + "failed to enable port for sniffing, result=%d\n", + result); goto failed; } } @@ -1225,8 +1236,9 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp) hw->sniff_channel = word; if (result) { - pr_debug("failed to set channel %d, result=%d\n", - word, result); + netdev_dbg(wlandev->netdev, + "failed to set channel %d, result=%d\n", + word, result); goto failed; } @@ -1238,8 +1250,9 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp) HFA384x_RID_CNFPORTTYPE, word); if (result) { - pr_debug - ("failed to set porttype %d, result=%d\n", + netdev_dbg + (wlandev->netdev, + "failed to set porttype %d, result=%d\n", word, result); goto failed; } @@ -1257,8 +1270,9 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp) } if (result) { - pr_debug - ("failed to set wepflags=0x%04x, result=%d\n", + netdev_dbg + (wlandev->netdev, + "failed to set wepflags=0x%04x, result=%d\n", word, result); goto failed; } @@ -1283,16 +1297,18 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp) /* Enable the port */ result = hfa384x_drvr_enable(hw, 0); if (result) { - pr_debug - ("failed to enable port for sniffing, result=%d\n", + netdev_dbg + (wlandev->netdev, + "failed to enable port for sniffing, result=%d\n", result); goto failed; } /* Enable monitor mode */ result = hfa384x_cmd_monitor(hw, HFA384x_MONITOR_ENABLE); if (result) { - pr_debug("failed to enable monitor mode, result=%d\n", - result); + netdev_dbg(wlandev->netdev, + "failed to enable monitor mode, result=%d\n", + result); goto failed; } diff --git a/drivers/staging/wlan-ng/prism2mgmt.h b/drivers/staging/wlan-ng/prism2mgmt.h index 88b979ff68b3..c062418f1202 100644 --- a/drivers/staging/wlan-ng/prism2mgmt.h +++ b/drivers/staging/wlan-ng/prism2mgmt.h @@ -109,7 +109,7 @@ int prism2mgmt_get_grpaddr_index(u32 did); void prism2sta_processing_defer(struct work_struct *data); void prism2sta_commsqual_defer(struct work_struct *data); -void prism2sta_commsqual_timer(unsigned long data); +void prism2sta_commsqual_timer(struct timer_list *t); /* Interface callback functions, passing data back up to the cfg80211 layer */ void prism2_connect_result(struct wlandevice *wlandev, u8 failed); diff --git a/drivers/staging/wlan-ng/prism2sta.c b/drivers/staging/wlan-ng/prism2sta.c index c9df45063ab3..99316b9a4e49 100644 --- a/drivers/staging/wlan-ng/prism2sta.c +++ b/drivers/staging/wlan-ng/prism2sta.c @@ -1447,7 +1447,7 @@ static void prism2sta_inf_linkstatus(struct wlandevice *wlandev, { struct hfa384x *hw = wlandev->priv; - hw->link_status_new = inf->info.linkstatus.linkstatus; + hw->link_status_new = le16_to_cpu(inf->info.linkstatus.linkstatus); schedule_work(&hw->link_bh); } @@ -2004,9 +2004,9 @@ void prism2sta_commsqual_defer(struct work_struct *data) mod_timer(&hw->commsqual_timer, jiffies + HZ); } -void prism2sta_commsqual_timer(unsigned long data) +void prism2sta_commsqual_timer(struct timer_list *t) { - struct hfa384x *hw = (struct hfa384x *)data; + struct hfa384x *hw = from_timer(hw, t, commsqual_timer); schedule_work(&hw->commsqual_bh); } |