diff options
Diffstat (limited to 'drivers/staging/wlan-ng/prism2mib.c')
| -rw-r--r-- | drivers/staging/wlan-ng/prism2mib.c | 104 |
1 files changed, 49 insertions, 55 deletions
diff --git a/drivers/staging/wlan-ng/prism2mib.c b/drivers/staging/wlan-ng/prism2mib.c index 5a6ba86009d..0fb42dfca2a 100644 --- a/drivers/staging/wlan-ng/prism2mib.c +++ b/drivers/staging/wlan-ng/prism2mib.c @@ -50,12 +50,10 @@ * -------------------------------------------------------------------- */ -#include <linux/version.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/types.h> -#include <linux/slab.h> #include <linux/wireless.h> #include <linux/netdevice.h> #include <linux/io.h> @@ -81,7 +79,7 @@ #define F_READ 0x2 /* MIB may be read. */ #define F_WRITE 0x4 /* MIB may be written. */ -typedef struct mibrec { +struct mibrec { u32 did; u16 flag; u16 parm1; @@ -91,63 +89,63 @@ typedef struct mibrec { int isget, wlandevice_t *wlandev, hfa384x_t *hw, - p80211msg_dot11req_mibset_t *msg, void *data); -} mibrec_t; + struct p80211msg_dot11req_mibset *msg, void *data); +}; -static int prism2mib_bytearea2pstr(mibrec_t *mib, +static int prism2mib_bytearea2pstr(struct mibrec *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, - p80211msg_dot11req_mibset_t *msg, + struct p80211msg_dot11req_mibset *msg, void *data); -static int prism2mib_uint32(mibrec_t *mib, +static int prism2mib_uint32(struct mibrec *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, - p80211msg_dot11req_mibset_t *msg, void *data); + struct p80211msg_dot11req_mibset *msg, void *data); -static int prism2mib_flag(mibrec_t *mib, +static int prism2mib_flag(struct mibrec *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, - p80211msg_dot11req_mibset_t *msg, void *data); + struct p80211msg_dot11req_mibset *msg, void *data); -static int prism2mib_wepdefaultkey(mibrec_t *mib, +static int prism2mib_wepdefaultkey(struct mibrec *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, - p80211msg_dot11req_mibset_t *msg, + struct p80211msg_dot11req_mibset *msg, void *data); -static int prism2mib_privacyinvoked(mibrec_t *mib, +static int prism2mib_privacyinvoked(struct mibrec *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, - p80211msg_dot11req_mibset_t *msg, + struct p80211msg_dot11req_mibset *msg, void *data); -static int prism2mib_excludeunencrypted(mibrec_t *mib, +static int prism2mib_excludeunencrypted(struct mibrec *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, - p80211msg_dot11req_mibset_t *msg, + struct p80211msg_dot11req_mibset *msg, void *data); -static int prism2mib_fragmentationthreshold(mibrec_t *mib, +static int prism2mib_fragmentationthreshold(struct mibrec *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, - p80211msg_dot11req_mibset_t *msg, + struct p80211msg_dot11req_mibset *msg, void *data); -static int prism2mib_priv(mibrec_t *mib, +static int prism2mib_priv(struct mibrec *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, - p80211msg_dot11req_mibset_t *msg, void *data); + struct p80211msg_dot11req_mibset *msg, void *data); -static mibrec_t mibtab[] = { +static struct mibrec mibtab[] = { /* dot11smt MIB's */ {DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey0, @@ -263,11 +261,11 @@ int prism2mgmt_mibset_mibget(wlandevice_t *wlandev, void *msgp) { hfa384x_t *hw = wlandev->priv; int result, isget; - mibrec_t *mib; + struct mibrec *mib; u16 which; - p80211msg_dot11req_mibset_t *msg = msgp; + struct p80211msg_dot11req_mibset *msg = msgp; p80211itemd_t *mibitem; msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; @@ -331,8 +329,7 @@ int prism2mgmt_mibset_mibget(wlandevice_t *wlandev, void *msgp) if (msg->resultcode.data == P80211ENUM_resultcode_success) { if (result != 0) { - pr_debug("get/set failure, result=%d\n", - result); + pr_debug("get/set failure, result=%d\n", result); msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; } else { @@ -374,11 +371,11 @@ done: * ----------------------------------------------------------------*/ -static int prism2mib_bytearea2pstr(mibrec_t *mib, +static int prism2mib_bytearea2pstr(struct mibrec *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, - p80211msg_dot11req_mibset_t *msg, + struct p80211msg_dot11req_mibset *msg, void *data) { int result; @@ -424,11 +421,11 @@ static int prism2mib_bytearea2pstr(mibrec_t *mib, * ----------------------------------------------------------------*/ -static int prism2mib_uint32(mibrec_t *mib, +static int prism2mib_uint32(struct mibrec *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, - p80211msg_dot11req_mibset_t *msg, void *data) + struct p80211msg_dot11req_mibset *msg, void *data) { int result; u32 *uint32 = (u32 *) data; @@ -471,11 +468,11 @@ static int prism2mib_uint32(mibrec_t *mib, * ----------------------------------------------------------------*/ -static int prism2mib_flag(mibrec_t *mib, +static int prism2mib_flag(struct mibrec *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, - p80211msg_dot11req_mibset_t *msg, void *data) + struct p80211msg_dot11req_mibset *msg, void *data) { int result; u32 *uint32 = (u32 *) data; @@ -528,11 +525,11 @@ static int prism2mib_flag(mibrec_t *mib, * ----------------------------------------------------------------*/ -static int prism2mib_wepdefaultkey(mibrec_t *mib, +static int prism2mib_wepdefaultkey(struct mibrec *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, - p80211msg_dot11req_mibset_t *msg, + struct p80211msg_dot11req_mibset *msg, void *data) { int result; @@ -578,11 +575,11 @@ static int prism2mib_wepdefaultkey(mibrec_t *mib, * ----------------------------------------------------------------*/ -static int prism2mib_privacyinvoked(mibrec_t *mib, +static int prism2mib_privacyinvoked(struct mibrec *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, - p80211msg_dot11req_mibset_t *msg, + struct p80211msg_dot11req_mibset *msg, void *data) { int result; @@ -624,11 +621,11 @@ static int prism2mib_privacyinvoked(mibrec_t *mib, * ----------------------------------------------------------------*/ -static int prism2mib_excludeunencrypted(mibrec_t *mib, +static int prism2mib_excludeunencrypted(struct mibrec *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, - p80211msg_dot11req_mibset_t *msg, + struct p80211msg_dot11req_mibset *msg, void *data) { int result; @@ -663,11 +660,11 @@ static int prism2mib_excludeunencrypted(mibrec_t *mib, * ----------------------------------------------------------------*/ -static int prism2mib_fragmentationthreshold(mibrec_t *mib, +static int prism2mib_fragmentationthreshold(struct mibrec *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, - p80211msg_dot11req_mibset_t *msg, + struct p80211msg_dot11req_mibset *msg, void *data) { int result; @@ -675,7 +672,7 @@ static int prism2mib_fragmentationthreshold(mibrec_t *mib, if (!isget) if ((*uint32) % 2) { - printk(KERN_WARNING "Attempt to set odd number " + netdev_warn(wlandev->netdev, "Attempt to set odd number " "FragmentationThreshold\n"); msg->resultcode.data = P80211ENUM_resultcode_not_supported; @@ -712,11 +709,11 @@ static int prism2mib_fragmentationthreshold(mibrec_t *mib, * ----------------------------------------------------------------*/ -static int prism2mib_priv(mibrec_t *mib, +static int prism2mib_priv(struct mibrec *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, - p80211msg_dot11req_mibset_t *msg, void *data) + struct p80211msg_dot11req_mibset *msg, void *data) { p80211pstrd_t *pstr = (p80211pstrd_t *) data; @@ -728,7 +725,7 @@ static int prism2mib_priv(mibrec_t *mib, if (isget) { hfa384x_drvr_getconfig(hw, HFA384x_RID_CNFWPADATA, - (u8 *)&wpa, + (u8 *) &wpa, sizeof(wpa)); pstr->len = le16_to_cpu(wpa.datalen); memcpy(pstr->data, wpa.data, pstr->len); @@ -738,14 +735,14 @@ static int prism2mib_priv(mibrec_t *mib, result = hfa384x_drvr_setconfig(hw, - HFA384x_RID_CNFWPADATA, - (u8 *)&wpa, - sizeof(wpa)); + HFA384x_RID_CNFWPADATA, + (u8 *) &wpa, + sizeof(wpa)); } break; } default: - printk(KERN_ERR "Unhandled DID 0x%08x\n", mib->did); + netdev_err(wlandev->netdev, "Unhandled DID 0x%08x\n", mib->did); } return 0; @@ -766,7 +763,8 @@ static int prism2mib_priv(mibrec_t *mib, * ----------------------------------------------------------------*/ -void prism2mgmt_pstr2bytestr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr) +void prism2mgmt_pstr2bytestr(struct hfa384x_bytestr *bytestr, + p80211pstrd_t *pstr) { bytestr->len = cpu_to_le16((u16) (pstr->len)); memcpy(bytestr->data, pstr->data, pstr->len); @@ -807,7 +805,8 @@ void prism2mgmt_pstr2bytearea(u8 *bytearea, p80211pstrd_t *pstr) * ----------------------------------------------------------------*/ -void prism2mgmt_bytestr2pstr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr) +void prism2mgmt_bytestr2pstr(struct hfa384x_bytestr *bytestr, + p80211pstrd_t *pstr) { pstr->len = (u8) (le16_to_cpu((u16) (bytestr->len))); memcpy(pstr->data, bytestr->data, pstr->len); @@ -833,8 +832,3 @@ void prism2mgmt_bytearea2pstr(u8 *bytearea, p80211pstrd_t *pstr, int len) pstr->len = (u8) len; memcpy(pstr->data, bytearea, len); } - - - - - |
