summaryrefslogtreecommitdiff
path: root/drivers/staging/wlan-ng
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/wlan-ng')
-rw-r--r--drivers/staging/wlan-ng/TODO16
-rw-r--r--drivers/staging/wlan-ng/p80211mgmt.h301
-rw-r--r--drivers/staging/wlan-ng/p80211netdev.c22
-rw-r--r--drivers/staging/wlan-ng/p80211types.h6
4 files changed, 16 insertions, 329 deletions
diff --git a/drivers/staging/wlan-ng/TODO b/drivers/staging/wlan-ng/TODO
new file mode 100644
index 000000000000..ab9d5d145b3b
--- /dev/null
+++ b/drivers/staging/wlan-ng/TODO
@@ -0,0 +1,16 @@
+To-do list:
+
+* Correct the coding style according to Linux guidelines; please read the document
+ at https://www.kernel.org/doc/html/latest/process/coding-style.html.
+* Remove unnecessary debugging/printing macros; for those that are still needed
+ use the proper kernel API (pr_debug(), dev_dbg(), netdev_dbg()).
+* Remove dead code such as unusued functions, variables, fields, etc..
+* Use in-kernel API and remove unnecessary wrappers where possible.
+* Fix bugs due to code that sleeps in atomic context.
+* Remove the HAL layer and migrate its functionality into the relevant parts of
+ the driver.
+* Switch to use LIB80211.
+* Switch to use MAC80211.
+* Switch to use CFG80211.
+* Improve the error handling of various functions, particularly those that use
+ existing kernel APIs.
diff --git a/drivers/staging/wlan-ng/p80211mgmt.h b/drivers/staging/wlan-ng/p80211mgmt.h
index 1ef30d3f3159..fc23fae5651b 100644
--- a/drivers/staging/wlan-ng/p80211mgmt.h
+++ b/drivers/staging/wlan-ng/p80211mgmt.h
@@ -217,305 +217,4 @@
#define WLAN_SET_MGMT_CAP_INFO_PBCC(n) ((n) << 6)
#define WLAN_SET_MGMT_CAP_INFO_AGILITY(n) ((n) << 7)
-/*-- Information Element Types --------------------*/
-/* prototype structure, all IEs start with these members */
-
-struct wlan_ie {
- u8 eid;
- u8 len;
-} __packed;
-
-/*-- Service Set Identity (SSID) -----------------*/
-struct wlan_ie_ssid {
- u8 eid;
- u8 len;
- u8 ssid[1]; /* may be zero, ptrs may overlap */
-} __packed;
-
-/*-- Supported Rates -----------------------------*/
-struct wlan_ie_supp_rates {
- u8 eid;
- u8 len;
- u8 rates[1]; /* had better be at LEAST one! */
-} __packed;
-
-/*-- FH Parameter Set ----------------------------*/
-struct wlan_ie_fh_parms {
- u8 eid;
- u8 len;
- u16 dwell;
- u8 hopset;
- u8 hoppattern;
- u8 hopindex;
-} __packed;
-
-/*-- DS Parameter Set ----------------------------*/
-struct wlan_ie_ds_parms {
- u8 eid;
- u8 len;
- u8 curr_ch;
-} __packed;
-
-/*-- CF Parameter Set ----------------------------*/
-
-struct wlan_ie_cf_parms {
- u8 eid;
- u8 len;
- u8 cfp_cnt;
- u8 cfp_period;
- u16 cfp_maxdur;
- u16 cfp_durremaining;
-} __packed;
-
-/*-- TIM ------------------------------------------*/
-struct wlan_ie_tim {
- u8 eid;
- u8 len;
- u8 dtim_cnt;
- u8 dtim_period;
- u8 bitmap_ctl;
- u8 virt_bm[1];
-} __packed;
-
-/*-- IBSS Parameter Set ---------------------------*/
-struct wlan_ie_ibss_parms {
- u8 eid;
- u8 len;
- u16 atim_win;
-} __packed;
-
-/*-- Challenge Text ------------------------------*/
-struct wlan_ie_challenge {
- u8 eid;
- u8 len;
- u8 challenge[1];
-} __packed;
-
-/*-------------------------------------------------*/
-/* Frame Types */
-
-/* prototype structure, all mgmt frame types will start with these members */
-struct wlan_fr_mgmt {
- u16 type;
- u16 len; /* DOES NOT include CRC !!!! */
- u8 *buf;
- struct p80211_hdr *hdr;
- /* used for target specific data, skb in Linux */
- void *priv;
- /*-- fixed fields -----------*/
- /*-- info elements ----------*/
-};
-
-/*-- Beacon ---------------------------------------*/
-struct wlan_fr_beacon {
- u16 type;
- u16 len;
- u8 *buf;
- struct p80211_hdr *hdr;
- /* used for target specific data, skb in Linux */
- void *priv;
- /*-- fixed fields -----------*/
- u64 *ts;
- u16 *bcn_int;
- u16 *cap_info;
- /*-- info elements ----------*/
- struct wlan_ie_ssid *ssid;
- struct wlan_ie_supp_rates *supp_rates;
- struct wlan_ie_fh_parms *fh_parms;
- struct wlan_ie_ds_parms *ds_parms;
- struct wlan_ie_cf_parms *cf_parms;
- struct wlan_ie_ibss_parms *ibss_parms;
- struct wlan_ie_tim *tim;
-
-};
-
-/*-- IBSS ATIM ------------------------------------*/
-struct wlan_fr_ibssatim {
- u16 type;
- u16 len;
- u8 *buf;
- struct p80211_hdr *hdr;
- /* used for target specific data, skb in Linux */
- void *priv;
-
- /*-- fixed fields -----------*/
- /*-- info elements ----------*/
-
- /* this frame type has a null body */
-
-};
-
-/*-- Disassociation -------------------------------*/
-struct wlan_fr_disassoc {
- u16 type;
- u16 len;
- u8 *buf;
- struct p80211_hdr *hdr;
- /* used for target specific data, skb in Linux */
- void *priv;
- /*-- fixed fields -----------*/
- u16 *reason;
-
- /*-- info elements ----------*/
-
-};
-
-/*-- Association Request --------------------------*/
-struct wlan_fr_assocreq {
- u16 type;
- u16 len;
- u8 *buf;
- struct p80211_hdr *hdr;
- /* used for target specific data, skb in Linux */
- void *priv;
- /*-- fixed fields -----------*/
- u16 *cap_info;
- u16 *listen_int;
- /*-- info elements ----------*/
- struct wlan_ie_ssid *ssid;
- struct wlan_ie_supp_rates *supp_rates;
-
-};
-
-/*-- Association Response -------------------------*/
-struct wlan_fr_assocresp {
- u16 type;
- u16 len;
- u8 *buf;
- struct p80211_hdr *hdr;
- /* used for target specific data, skb in Linux */
- void *priv;
- /*-- fixed fields -----------*/
- u16 *cap_info;
- u16 *status;
- u16 *aid;
- /*-- info elements ----------*/
- struct wlan_ie_supp_rates *supp_rates;
-
-};
-
-/*-- Reassociation Request ------------------------*/
-struct wlan_fr_reassocreq {
- u16 type;
- u16 len;
- u8 *buf;
- struct p80211_hdr *hdr;
- /* used for target specific data, skb in Linux */
- void *priv;
- /*-- fixed fields -----------*/
- u16 *cap_info;
- u16 *listen_int;
- u8 *curr_ap;
- /*-- info elements ----------*/
- struct wlan_ie_ssid *ssid;
- struct wlan_ie_supp_rates *supp_rates;
-
-};
-
-/*-- Reassociation Response -----------------------*/
-struct wlan_fr_reassocresp {
- u16 type;
- u16 len;
- u8 *buf;
- struct p80211_hdr *hdr;
- /* used for target specific data, skb in Linux */
- void *priv;
- /*-- fixed fields -----------*/
- u16 *cap_info;
- u16 *status;
- u16 *aid;
- /*-- info elements ----------*/
- struct wlan_ie_supp_rates *supp_rates;
-
-};
-
-/*-- Probe Request --------------------------------*/
-struct wlan_fr_probereq {
- u16 type;
- u16 len;
- u8 *buf;
- struct p80211_hdr *hdr;
- /* used for target specific data, skb in Linux */
- void *priv;
- /*-- fixed fields -----------*/
- /*-- info elements ----------*/
- struct wlan_ie_ssid *ssid;
- struct wlan_ie_supp_rates *supp_rates;
-
-};
-
-/*-- Probe Response -------------------------------*/
-struct wlan_fr_proberesp {
- u16 type;
- u16 len;
- u8 *buf;
- struct p80211_hdr *hdr;
- /* used for target specific data, skb in Linux */
- void *priv;
- /*-- fixed fields -----------*/
- u64 *ts;
- u16 *bcn_int;
- u16 *cap_info;
- /*-- info elements ----------*/
- struct wlan_ie_ssid *ssid;
- struct wlan_ie_supp_rates *supp_rates;
- struct wlan_ie_fh_parms *fh_parms;
- struct wlan_ie_ds_parms *ds_parms;
- struct wlan_ie_cf_parms *cf_parms;
- struct wlan_ie_ibss_parms *ibss_parms;
-};
-
-/*-- Authentication -------------------------------*/
-struct wlan_fr_authen {
- u16 type;
- u16 len;
- u8 *buf;
- struct p80211_hdr *hdr;
- /* used for target specific data, skb in Linux */
- void *priv;
- /*-- fixed fields -----------*/
- u16 *auth_alg;
- u16 *auth_seq;
- u16 *status;
- /*-- info elements ----------*/
- struct wlan_ie_challenge *challenge;
-
-};
-
-/*-- Deauthenication -----------------------------*/
-struct wlan_fr_deauthen {
- u16 type;
- u16 len;
- u8 *buf;
- struct p80211_hdr *hdr;
- /* used for target specific data, skb in Linux */
- void *priv;
- /*-- fixed fields -----------*/
- u16 *reason;
-
- /*-- info elements ----------*/
-
-};
-
-void wlan_mgmt_encode_beacon(struct wlan_fr_beacon *f);
-void wlan_mgmt_decode_beacon(struct wlan_fr_beacon *f);
-void wlan_mgmt_encode_disassoc(struct wlan_fr_disassoc *f);
-void wlan_mgmt_decode_disassoc(struct wlan_fr_disassoc *f);
-void wlan_mgmt_encode_assocreq(struct wlan_fr_assocreq *f);
-void wlan_mgmt_decode_assocreq(struct wlan_fr_assocreq *f);
-void wlan_mgmt_encode_assocresp(struct wlan_fr_assocresp *f);
-void wlan_mgmt_decode_assocresp(struct wlan_fr_assocresp *f);
-void wlan_mgmt_encode_reassocreq(struct wlan_fr_reassocreq *f);
-void wlan_mgmt_decode_reassocreq(struct wlan_fr_reassocreq *f);
-void wlan_mgmt_encode_reassocresp(struct wlan_fr_reassocresp *f);
-void wlan_mgmt_decode_reassocresp(struct wlan_fr_reassocresp *f);
-void wlan_mgmt_encode_probereq(struct wlan_fr_probereq *f);
-void wlan_mgmt_decode_probereq(struct wlan_fr_probereq *f);
-void wlan_mgmt_encode_proberesp(struct wlan_fr_proberesp *f);
-void wlan_mgmt_decode_proberesp(struct wlan_fr_proberesp *f);
-void wlan_mgmt_encode_authen(struct wlan_fr_authen *f);
-void wlan_mgmt_decode_authen(struct wlan_fr_authen *f);
-void wlan_mgmt_encode_deauthen(struct wlan_fr_deauthen *f);
-void wlan_mgmt_decode_deauthen(struct wlan_fr_deauthen *f);
-
#endif /* _P80211MGMT_H */
diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c
index e04fc666d218..6bef419e8ad0 100644
--- a/drivers/staging/wlan-ng/p80211netdev.c
+++ b/drivers/staging/wlan-ng/p80211netdev.c
@@ -881,55 +881,42 @@ static int p80211_rx_typedrop(struct wlandevice *wlandev, u16 fc)
wlandev->rx.mgmt++;
switch (fstype) {
case WLAN_FSTYPE_ASSOCREQ:
- /* printk("assocreq"); */
wlandev->rx.assocreq++;
break;
case WLAN_FSTYPE_ASSOCRESP:
- /* printk("assocresp"); */
wlandev->rx.assocresp++;
break;
case WLAN_FSTYPE_REASSOCREQ:
- /* printk("reassocreq"); */
wlandev->rx.reassocreq++;
break;
case WLAN_FSTYPE_REASSOCRESP:
- /* printk("reassocresp"); */
wlandev->rx.reassocresp++;
break;
case WLAN_FSTYPE_PROBEREQ:
- /* printk("probereq"); */
wlandev->rx.probereq++;
break;
case WLAN_FSTYPE_PROBERESP:
- /* printk("proberesp"); */
wlandev->rx.proberesp++;
break;
case WLAN_FSTYPE_BEACON:
- /* printk("beacon"); */
wlandev->rx.beacon++;
break;
case WLAN_FSTYPE_ATIM:
- /* printk("atim"); */
wlandev->rx.atim++;
break;
case WLAN_FSTYPE_DISASSOC:
- /* printk("disassoc"); */
wlandev->rx.disassoc++;
break;
case WLAN_FSTYPE_AUTHEN:
- /* printk("authen"); */
wlandev->rx.authen++;
break;
case WLAN_FSTYPE_DEAUTHEN:
- /* printk("deauthen"); */
wlandev->rx.deauthen++;
break;
default:
- /* printk("unknown"); */
wlandev->rx.mgmt_unknown++;
break;
}
- /* printk("\n"); */
drop = 2;
break;
@@ -943,35 +930,27 @@ static int p80211_rx_typedrop(struct wlandevice *wlandev, u16 fc)
wlandev->rx.ctl++;
switch (fstype) {
case WLAN_FSTYPE_PSPOLL:
- /* printk("pspoll"); */
wlandev->rx.pspoll++;
break;
case WLAN_FSTYPE_RTS:
- /* printk("rts"); */
wlandev->rx.rts++;
break;
case WLAN_FSTYPE_CTS:
- /* printk("cts"); */
wlandev->rx.cts++;
break;
case WLAN_FSTYPE_ACK:
- /* printk("ack"); */
wlandev->rx.ack++;
break;
case WLAN_FSTYPE_CFEND:
- /* printk("cfend"); */
wlandev->rx.cfend++;
break;
case WLAN_FSTYPE_CFENDCFACK:
- /* printk("cfendcfack"); */
wlandev->rx.cfendcfack++;
break;
default:
- /* printk("unknown"); */
wlandev->rx.ctl_unknown++;
break;
}
- /* printk("\n"); */
drop = 2;
break;
@@ -1007,7 +986,6 @@ static int p80211_rx_typedrop(struct wlandevice *wlandev, u16 fc)
wlandev->rx.cfack_cfpoll++;
break;
default:
- /* printk("unknown"); */
wlandev->rx.data_unknown++;
break;
}
diff --git a/drivers/staging/wlan-ng/p80211types.h b/drivers/staging/wlan-ng/p80211types.h
index 6486612a8f31..b2ed96960413 100644
--- a/drivers/staging/wlan-ng/p80211types.h
+++ b/drivers/staging/wlan-ng/p80211types.h
@@ -231,12 +231,6 @@ struct p80211pstr32 {
u8 data[MAXLEN_PSTR32];
} __packed;
-/* MAC address array */
-struct p80211macarray {
- u32 cnt;
- u8 data[1][MAXLEN_PSTR6];
-} __packed;
-
/* prototype template */
struct p80211item {
u32 did;