Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 111231
b: refs/heads/master
c: 06009fd
h: refs/heads/master
i:
  111229: c0830c8
  111227: 1b1b0cf
  111223: b4925f5
  111215: c438566
  111199: f7002c5
  111167: 86471e5
  111103: b9bf356
v: v3
  • Loading branch information
David Kilroy authored and John W. Linville committed Aug 22, 2008
1 parent 5023647 commit 8ab8510
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d03032af511c56d3c1580fa4f54f6285f650e638
refs/heads/master: 06009fda9fde1b97074ab3d932d0468396bf5d10
62 changes: 62 additions & 0 deletions trunk/drivers/net/wireless/orinoco.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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);
Expand Down

0 comments on commit 8ab8510

Please sign in to comment.