From 8ab8510ee71fb5af87b84a1dfd7b6283b42a2235 Mon Sep 17 00:00:00 2001 From: David Kilroy Date: Thu, 21 Aug 2008 23:28:03 +0100 Subject: [PATCH] --- yaml --- r: 111231 b: refs/heads/master c: 06009fda9fde1b97074ab3d932d0468396bf5d10 h: refs/heads/master i: 111229: c0830c84a04d786de3b7c2a5221de6f84d0a3325 111227: 1b1b0cf6f93130bb4e8635889e241d787a04104a 111223: b4925f5057ffb65cc961cbcef876ec6f510ecffb 111215: c4385665a07b5faffa7e44742946a0c4359ac31c 111199: f7002c55fc9736abdc5628380e3d3087c51af10e 111167: 86471e5e50f291973556a822b96acc356e531df8 111103: b9bf35609ab82767317c61cbec95ac4c00b49718 v: v3 --- [refs] | 2 +- trunk/drivers/net/wireless/orinoco.c | 62 ++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 77d5e8774eb6..d56303233e7e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d03032af511c56d3c1580fa4f54f6285f650e638 +refs/heads/master: 06009fda9fde1b97074ab3d932d0468396bf5d10 diff --git a/trunk/drivers/net/wireless/orinoco.c b/trunk/drivers/net/wireless/orinoco.c index 36b1dc2db893..5e6f90ba9088 100644 --- a/trunk/drivers/net/wireless/orinoco.c +++ b/trunk/drivers/net/wireless/orinoco.c @@ -1443,6 +1443,66 @@ static void orinoco_send_bssid_wevent(struct orinoco_private *priv) wireless_send_event(dev, SIOCGIWAP, &wrqu, NULL); } +static void orinoco_send_assocreqie_wevent(struct orinoco_private *priv) +{ + struct net_device *dev = priv->ndev; + struct hermes *hw = &priv->hw; + union iwreq_data wrqu; + int err; + u8 buf[88]; + u8 *ie; + + if (!priv->has_wpa) + return; + + err = hermes_read_ltv(hw, IRQ_BAP, HERMES_RID_CURRENT_ASSOC_REQ_INFO, + sizeof(buf), NULL, &buf); + if (err != 0) + return; + + ie = orinoco_get_wpa_ie(buf, sizeof(buf)); + if (ie) { + int rem = sizeof(buf) - (ie - &buf[0]); + wrqu.data.length = ie[1] + 2; + if (wrqu.data.length > rem) + wrqu.data.length = rem; + + if (wrqu.data.length) + /* Send event to user space */ + wireless_send_event(dev, IWEVASSOCREQIE, &wrqu, ie); + } +} + +static void orinoco_send_assocrespie_wevent(struct orinoco_private *priv) +{ + struct net_device *dev = priv->ndev; + struct hermes *hw = &priv->hw; + union iwreq_data wrqu; + int err; + u8 buf[88]; /* TODO: verify max size or IW_GENERIC_IE_MAX */ + u8 *ie; + + if (!priv->has_wpa) + return; + + err = hermes_read_ltv(hw, IRQ_BAP, HERMES_RID_CURRENT_ASSOC_RESP_INFO, + sizeof(buf), NULL, &buf); + if (err != 0) + return; + + ie = orinoco_get_wpa_ie(buf, sizeof(buf)); + if (ie) { + int rem = sizeof(buf) - (ie - &buf[0]); + wrqu.data.length = ie[1] + 2; + if (wrqu.data.length > rem) + wrqu.data.length = rem; + + if (wrqu.data.length) + /* Send event to user space */ + wireless_send_event(dev, IWEVASSOCRESPIE, &wrqu, ie); + } +} + static void orinoco_send_wevents(struct work_struct *work) { struct orinoco_private *priv = @@ -1452,6 +1512,8 @@ static void orinoco_send_wevents(struct work_struct *work) if (orinoco_lock(priv, &flags) != 0) return; + orinoco_send_assocreqie_wevent(priv); + orinoco_send_assocrespie_wevent(priv); orinoco_send_bssid_wevent(priv); orinoco_unlock(priv, &flags);