aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/orinoco.c
diff options
context:
space:
mode:
authorDavid Kilroy <kilroyd@gmail.com>2008-08-21 18:28:03 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-08-22 19:28:06 -0400
commit06009fda9fde1b97074ab3d932d0468396bf5d10 (patch)
treee4cf6808c846c1078512422f94631e275d209e93 /drivers/net/wireless/orinoco.c
parentd03032af511c56d3c1580fa4f54f6285f650e638 (diff)
orinoco: Send association events to userspace
Signed-off-by: David Kilroy <kilroyd@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/orinoco.c')
-rw-r--r--drivers/net/wireless/orinoco.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index 36b1dc2db893..5e6f90ba9088 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -1443,6 +1443,66 @@ static void orinoco_send_bssid_wevent(struct orinoco_private *priv)
1443 wireless_send_event(dev, SIOCGIWAP, &wrqu, NULL); 1443 wireless_send_event(dev, SIOCGIWAP, &wrqu, NULL);
1444} 1444}
1445 1445
1446static void orinoco_send_assocreqie_wevent(struct orinoco_private *priv)
1447{
1448 struct net_device *dev = priv->ndev;
1449 struct hermes *hw = &priv->hw;
1450 union iwreq_data wrqu;
1451 int err;
1452 u8 buf[88];
1453 u8 *ie;
1454
1455 if (!priv->has_wpa)
1456 return;
1457
1458 err = hermes_read_ltv(hw, IRQ_BAP, HERMES_RID_CURRENT_ASSOC_REQ_INFO,
1459 sizeof(buf), NULL, &buf);
1460 if (err != 0)
1461 return;
1462
1463 ie = orinoco_get_wpa_ie(buf, sizeof(buf));
1464 if (ie) {
1465 int rem = sizeof(buf) - (ie - &buf[0]);
1466 wrqu.data.length = ie[1] + 2;
1467 if (wrqu.data.length > rem)
1468 wrqu.data.length = rem;
1469
1470 if (wrqu.data.length)
1471 /* Send event to user space */
1472 wireless_send_event(dev, IWEVASSOCREQIE, &wrqu, ie);
1473 }
1474}
1475
1476static void orinoco_send_assocrespie_wevent(struct orinoco_private *priv)
1477{
1478 struct net_device *dev = priv->ndev;
1479 struct hermes *hw = &priv->hw;
1480 union iwreq_data wrqu;
1481 int err;
1482 u8 buf[88]; /* TODO: verify max size or IW_GENERIC_IE_MAX */
1483 u8 *ie;
1484
1485 if (!priv->has_wpa)
1486 return;
1487
1488 err = hermes_read_ltv(hw, IRQ_BAP, HERMES_RID_CURRENT_ASSOC_RESP_INFO,
1489 sizeof(buf), NULL, &buf);
1490 if (err != 0)
1491 return;
1492
1493 ie = orinoco_get_wpa_ie(buf, sizeof(buf));
1494 if (ie) {
1495 int rem = sizeof(buf) - (ie - &buf[0]);
1496 wrqu.data.length = ie[1] + 2;
1497 if (wrqu.data.length > rem)
1498 wrqu.data.length = rem;
1499
1500 if (wrqu.data.length)
1501 /* Send event to user space */
1502 wireless_send_event(dev, IWEVASSOCRESPIE, &wrqu, ie);
1503 }
1504}
1505
1446static void orinoco_send_wevents(struct work_struct *work) 1506static void orinoco_send_wevents(struct work_struct *work)
1447{ 1507{
1448 struct orinoco_private *priv = 1508 struct orinoco_private *priv =
@@ -1452,6 +1512,8 @@ static void orinoco_send_wevents(struct work_struct *work)
1452 if (orinoco_lock(priv, &flags) != 0) 1512 if (orinoco_lock(priv, &flags) != 0)
1453 return; 1513 return;
1454 1514
1515 orinoco_send_assocreqie_wevent(priv);
1516 orinoco_send_assocrespie_wevent(priv);
1455 orinoco_send_bssid_wevent(priv); 1517 orinoco_send_bssid_wevent(priv);
1456 1518
1457 orinoco_unlock(priv, &flags); 1519 orinoco_unlock(priv, &flags);