Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 97487
b: refs/heads/master
c: 4364623
h: refs/heads/master
i:
  97485: c4d0543
  97483: 59cfa4c
  97479: 1d1319b
  97471: b4ec51c
v: v3
  • Loading branch information
Scott Ashcroft authored and John W. Linville committed May 28, 2008
1 parent 7bdee34 commit f1fec00
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d4231ca3e162387a2b6964dacaa83604e065c4e9
refs/heads/master: 4364623cb79d02945ace7a4faa1f11e617dde198
60 changes: 58 additions & 2 deletions trunk/drivers/net/wireless/rndis_wlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ MODULE_PARM_DESC(workaround_interval,
#define OID_802_11_ENCRYPTION_STATUS ccpu2(0x0d01011b)
#define OID_802_11_ADD_KEY ccpu2(0x0d01011d)
#define OID_802_11_REMOVE_KEY ccpu2(0x0d01011e)
#define OID_802_11_ASSOCIATION_INFORMATION ccpu2(0x0d01011f)
#define OID_802_11_PMKID ccpu2(0x0d010123)
#define OID_802_11_NETWORK_TYPES_SUPPORTED ccpu2(0x0d010203)
#define OID_802_11_NETWORK_TYPE_IN_USE ccpu2(0x0d010204)
Expand Down Expand Up @@ -271,6 +272,26 @@ struct ndis_config_param {
__le32 value_length;
} __attribute__((packed));

struct ndis_80211_assoc_info {
__le32 length;
__le16 req_ies;
struct req_ie {
__le16 capa;
__le16 listen_interval;
u8 cur_ap_address[6];
} req_ie;
__le32 req_ie_length;
__le32 offset_req_ies;
__le16 resp_ies;
struct resp_ie {
__le16 capa;
__le16 status_code;
__le16 assoc_id;
} resp_ie;
__le32 resp_ie_length;
__le32 offset_resp_ies;
} __attribute__((packed));

/* these have to match what is in wpa_supplicant */
enum wpa_alg { WPA_ALG_NONE, WPA_ALG_WEP, WPA_ALG_TKIP, WPA_ALG_CCMP };
enum wpa_cipher { CIPHER_NONE, CIPHER_WEP40, CIPHER_TKIP, CIPHER_CCMP,
Expand Down Expand Up @@ -674,6 +695,12 @@ static int get_bssid(struct usbnet *usbdev, u8 bssid[ETH_ALEN])
return ret;
}

static int get_association_info(struct usbnet *usbdev,
struct ndis_80211_assoc_info *info, int len)
{
return rndis_query_oid(usbdev, OID_802_11_ASSOCIATION_INFORMATION,
info, &len);
}

static int is_associated(struct usbnet *usbdev)
{
Expand Down Expand Up @@ -2182,11 +2209,40 @@ static void rndis_wext_worker(struct work_struct *work)
struct usbnet *usbdev = priv->usbdev;
union iwreq_data evt;
unsigned char bssid[ETH_ALEN];
int ret;
struct ndis_80211_assoc_info *info;
int assoc_size = sizeof(*info) + IW_CUSTOM_MAX + 32;
int ret, offset;

if (test_and_clear_bit(WORK_CONNECTION_EVENT, &priv->work_pending)) {
ret = get_bssid(usbdev, bssid);
info = kzalloc(assoc_size, GFP_KERNEL);
if (!info)
goto get_bssid;

/* Get association info IEs from device and send them back to
* userspace. */
ret = get_association_info(usbdev, info, assoc_size);
if (!ret) {
evt.data.length = le32_to_cpu(info->req_ie_length);
if (evt.data.length > 0) {
offset = le32_to_cpu(info->offset_req_ies);
wireless_send_event(usbdev->net,
IWEVASSOCREQIE, &evt,
(char *)info + offset);
}

evt.data.length = le32_to_cpu(info->resp_ie_length);
if (evt.data.length > 0) {
offset = le32_to_cpu(info->offset_resp_ies);
wireless_send_event(usbdev->net,
IWEVASSOCRESPIE, &evt,
(char *)info + offset);
}
}

kfree(info);

get_bssid:
ret = get_bssid(usbdev, bssid);
if (!ret) {
evt.data.flags = 0;
evt.data.length = 0;
Expand Down

0 comments on commit f1fec00

Please sign in to comment.