Jouni Malinen | 6039f6d | 2009-03-19 13:39:21 +0200 | [diff] [blame] | 1 | /* |
| 2 | * cfg80211 MLME SAP interface |
| 3 | * |
| 4 | * Copyright (c) 2009, Jouni Malinen <j@w1.fi> |
| 5 | */ |
| 6 | |
| 7 | #include <linux/kernel.h> |
| 8 | #include <linux/module.h> |
| 9 | #include <linux/netdevice.h> |
| 10 | #include <linux/nl80211.h> |
| 11 | #include <net/cfg80211.h> |
| 12 | #include "core.h" |
| 13 | #include "nl80211.h" |
| 14 | |
| 15 | void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len) |
| 16 | { |
| 17 | struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; |
| 18 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); |
| 19 | nl80211_send_rx_auth(rdev, dev, buf, len); |
| 20 | } |
| 21 | EXPORT_SYMBOL(cfg80211_send_rx_auth); |
| 22 | |
| 23 | void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len) |
| 24 | { |
| 25 | struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; |
| 26 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); |
| 27 | nl80211_send_rx_assoc(rdev, dev, buf, len); |
| 28 | } |
| 29 | EXPORT_SYMBOL(cfg80211_send_rx_assoc); |
| 30 | |
Jouni Malinen | 53b46b8 | 2009-03-27 20:53:56 +0200 | [diff] [blame] | 31 | void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len) |
Jouni Malinen | 6039f6d | 2009-03-19 13:39:21 +0200 | [diff] [blame] | 32 | { |
| 33 | struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; |
| 34 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); |
Jouni Malinen | 53b46b8 | 2009-03-27 20:53:56 +0200 | [diff] [blame] | 35 | nl80211_send_deauth(rdev, dev, buf, len); |
Jouni Malinen | 6039f6d | 2009-03-19 13:39:21 +0200 | [diff] [blame] | 36 | } |
Jouni Malinen | 53b46b8 | 2009-03-27 20:53:56 +0200 | [diff] [blame] | 37 | EXPORT_SYMBOL(cfg80211_send_deauth); |
Jouni Malinen | 6039f6d | 2009-03-19 13:39:21 +0200 | [diff] [blame] | 38 | |
Jouni Malinen | 53b46b8 | 2009-03-27 20:53:56 +0200 | [diff] [blame] | 39 | void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len) |
Jouni Malinen | 6039f6d | 2009-03-19 13:39:21 +0200 | [diff] [blame] | 40 | { |
| 41 | struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; |
| 42 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); |
Jouni Malinen | 53b46b8 | 2009-03-27 20:53:56 +0200 | [diff] [blame] | 43 | nl80211_send_disassoc(rdev, dev, buf, len); |
Jouni Malinen | 6039f6d | 2009-03-19 13:39:21 +0200 | [diff] [blame] | 44 | } |
Jouni Malinen | 53b46b8 | 2009-03-27 20:53:56 +0200 | [diff] [blame] | 45 | EXPORT_SYMBOL(cfg80211_send_disassoc); |
Jouni Malinen | a3b8b05 | 2009-03-27 21:59:49 +0200 | [diff] [blame] | 46 | |
Jouni Malinen | 1965c85 | 2009-04-22 21:38:25 +0300 | [diff] [blame] | 47 | static void cfg80211_wext_disconnected(struct net_device *dev) |
| 48 | { |
| 49 | #ifdef CONFIG_WIRELESS_EXT |
| 50 | union iwreq_data wrqu; |
| 51 | memset(&wrqu, 0, sizeof(wrqu)); |
| 52 | wireless_send_event(dev, SIOCGIWAP, &wrqu, NULL); |
| 53 | #endif |
| 54 | } |
| 55 | |
| 56 | void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr) |
| 57 | { |
| 58 | struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; |
| 59 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); |
| 60 | nl80211_send_auth_timeout(rdev, dev, addr); |
| 61 | cfg80211_wext_disconnected(dev); |
| 62 | } |
| 63 | EXPORT_SYMBOL(cfg80211_send_auth_timeout); |
| 64 | |
| 65 | void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr) |
| 66 | { |
| 67 | struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; |
| 68 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); |
| 69 | nl80211_send_assoc_timeout(rdev, dev, addr); |
| 70 | cfg80211_wext_disconnected(dev); |
| 71 | } |
| 72 | EXPORT_SYMBOL(cfg80211_send_assoc_timeout); |
| 73 | |
Jouni Malinen | a3b8b05 | 2009-03-27 21:59:49 +0200 | [diff] [blame] | 74 | void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr, |
| 75 | enum nl80211_key_type key_type, int key_id, |
| 76 | const u8 *tsc) |
| 77 | { |
| 78 | struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; |
| 79 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); |
| 80 | nl80211_michael_mic_failure(rdev, dev, addr, key_type, key_id, tsc); |
| 81 | } |
| 82 | EXPORT_SYMBOL(cfg80211_michael_mic_failure); |