aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2013-06-21 15:42:30 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-06-21 15:42:30 -0400
commit7d2a47aab2a511c87a96238977e04e6378969d45 (patch)
treee3765af6d4b292d8f3c013a5962324eab683a931 /include
parentfedaf4ffc224a194e2d13a3ec2abe5df0bc94258 (diff)
parentb887664d882ee4f6a67e0bf05e5f141d32fcc067 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Conflicts: net/wireless/nl80211.c
Diffstat (limited to 'include')
-rw-r--r--include/linux/ieee80211.h1
-rw-r--r--include/linux/ssb/ssb_driver_mips.h15
-rw-r--r--include/net/cfg80211.h115
-rw-r--r--include/net/mac80211.h11
-rw-r--r--include/net/nfc/hci.h7
-rw-r--r--include/net/nfc/nci_core.h58
-rw-r--r--include/net/nfc/nfc.h35
-rw-r--r--include/uapi/linux/nfc.h18
-rw-r--r--include/uapi/linux/nl80211.h9
9 files changed, 191 insertions, 78 deletions
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index d826e5a84af0..b0dc87a2a376 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -146,6 +146,7 @@ static inline u16 ieee80211_sn_sub(u16 sn1, u16 sn2)
146#define IEEE80211_MAX_RTS_THRESHOLD 2353 146#define IEEE80211_MAX_RTS_THRESHOLD 2353
147#define IEEE80211_MAX_AID 2007 147#define IEEE80211_MAX_AID 2007
148#define IEEE80211_MAX_TIM_LEN 251 148#define IEEE80211_MAX_TIM_LEN 251
149#define IEEE80211_MAX_MESH_PEERINGS 63
149/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section 150/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
150 6.2.1.1.2. 151 6.2.1.1.2.
151 152
diff --git a/include/linux/ssb/ssb_driver_mips.h b/include/linux/ssb/ssb_driver_mips.h
index afe79d40a99e..6535e4718fde 100644
--- a/include/linux/ssb/ssb_driver_mips.h
+++ b/include/linux/ssb/ssb_driver_mips.h
@@ -20,6 +20,18 @@ struct ssb_pflash {
20 u32 window_size; 20 u32 window_size;
21}; 21};
22 22
23#ifdef CONFIG_SSB_SFLASH
24struct ssb_sflash {
25 bool present;
26 u32 window;
27 u32 blocksize;
28 u16 numblocks;
29 u32 size;
30
31 void *priv;
32};
33#endif
34
23struct ssb_mipscore { 35struct ssb_mipscore {
24 struct ssb_device *dev; 36 struct ssb_device *dev;
25 37
@@ -27,6 +39,9 @@ struct ssb_mipscore {
27 struct ssb_serial_port serial_ports[4]; 39 struct ssb_serial_port serial_ports[4];
28 40
29 struct ssb_pflash pflash; 41 struct ssb_pflash pflash;
42#ifdef CONFIG_SSB_SFLASH
43 struct ssb_sflash sflash;
44#endif
30}; 45};
31 46
32extern void ssb_mipscore_init(struct ssb_mipscore *mcore); 47extern void ssb_mipscore_init(struct ssb_mipscore *mcore);
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 6dd19593e333..6a43c34ce96f 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1124,6 +1124,9 @@ struct bss_parameters {
1124 * setting for new peer links. 1124 * setting for new peer links.
1125 * @dot11MeshAwakeWindowDuration: The duration in TUs the STA will remain awake 1125 * @dot11MeshAwakeWindowDuration: The duration in TUs the STA will remain awake
1126 * after transmitting its beacon. 1126 * after transmitting its beacon.
1127 * @plink_timeout: If no tx activity is seen from a STA we've established
1128 * peering with for longer than this time (in seconds), then remove it
1129 * from the STA's list of peers. Default is 30 minutes.
1127 */ 1130 */
1128struct mesh_config { 1131struct mesh_config {
1129 u16 dot11MeshRetryTimeout; 1132 u16 dot11MeshRetryTimeout;
@@ -1153,6 +1156,7 @@ struct mesh_config {
1153 u16 dot11MeshHWMPconfirmationInterval; 1156 u16 dot11MeshHWMPconfirmationInterval;
1154 enum nl80211_mesh_power_mode power_mode; 1157 enum nl80211_mesh_power_mode power_mode;
1155 u16 dot11MeshAwakeWindowDuration; 1158 u16 dot11MeshAwakeWindowDuration;
1159 u32 plink_timeout;
1156}; 1160};
1157 1161
1158/** 1162/**
@@ -1172,6 +1176,7 @@ struct mesh_config {
1172 * @dtim_period: DTIM period to use 1176 * @dtim_period: DTIM period to use
1173 * @beacon_interval: beacon interval to use 1177 * @beacon_interval: beacon interval to use
1174 * @mcast_rate: multicat rate for Mesh Node [6Mbps is the default for 802.11a] 1178 * @mcast_rate: multicat rate for Mesh Node [6Mbps is the default for 802.11a]
1179 * @basic_rates: basic rates to use when creating the mesh
1175 * 1180 *
1176 * These parameters are fixed when the mesh is created. 1181 * These parameters are fixed when the mesh is created.
1177 */ 1182 */
@@ -1191,6 +1196,7 @@ struct mesh_setup {
1191 u8 dtim_period; 1196 u8 dtim_period;
1192 u16 beacon_interval; 1197 u16 beacon_interval;
1193 int mcast_rate[IEEE80211_NUM_BANDS]; 1198 int mcast_rate[IEEE80211_NUM_BANDS];
1199 u32 basic_rates;
1194}; 1200};
1195 1201
1196/** 1202/**
@@ -2654,7 +2660,7 @@ struct wiphy {
2654 u32 hw_version; 2660 u32 hw_version;
2655 2661
2656#ifdef CONFIG_PM 2662#ifdef CONFIG_PM
2657 struct wiphy_wowlan_support wowlan; 2663 const struct wiphy_wowlan_support *wowlan;
2658 struct cfg80211_wowlan *wowlan_config; 2664 struct cfg80211_wowlan *wowlan_config;
2659#endif 2665#endif
2660 2666
@@ -2853,7 +2859,7 @@ struct cfg80211_cached_keys;
2853 * @current_bss: (private) Used by the internal configuration code 2859 * @current_bss: (private) Used by the internal configuration code
2854 * @channel: (private) Used by the internal configuration code to track 2860 * @channel: (private) Used by the internal configuration code to track
2855 * the user-set AP, monitor and WDS channel 2861 * the user-set AP, monitor and WDS channel
2856 * @preset_chan: (private) Used by the internal configuration code to 2862 * @preset_chandef: (private) Used by the internal configuration code to
2857 * track the channel to be used for AP later 2863 * track the channel to be used for AP later
2858 * @bssid: (private) Used by the internal configuration code 2864 * @bssid: (private) Used by the internal configuration code
2859 * @ssid: (private) Used by the internal configuration code 2865 * @ssid: (private) Used by the internal configuration code
@@ -2875,6 +2881,15 @@ struct cfg80211_cached_keys;
2875 * @p2p_started: true if this is a P2P Device that has been started 2881 * @p2p_started: true if this is a P2P Device that has been started
2876 * @cac_started: true if DFS channel availability check has been started 2882 * @cac_started: true if DFS channel availability check has been started
2877 * @cac_start_time: timestamp (jiffies) when the dfs state was entered. 2883 * @cac_start_time: timestamp (jiffies) when the dfs state was entered.
2884 * @ps: powersave mode is enabled
2885 * @ps_timeout: dynamic powersave timeout
2886 * @ap_unexpected_nlportid: (private) netlink port ID of application
2887 * registered for unexpected class 3 frames (AP mode)
2888 * @conn: (private) cfg80211 software SME connection state machine data
2889 * @connect_keys: (private) keys to set after connection is established
2890 * @ibss_fixed: (private) IBSS is using fixed BSSID
2891 * @event_list: (private) list for internal event processing
2892 * @event_lock: (private) lock for event list
2878 */ 2893 */
2879struct wireless_dev { 2894struct wireless_dev {
2880 struct wiphy *wiphy; 2895 struct wiphy *wiphy;
@@ -2898,11 +2913,6 @@ struct wireless_dev {
2898 /* currently used for IBSS and SME - might be rearranged later */ 2913 /* currently used for IBSS and SME - might be rearranged later */
2899 u8 ssid[IEEE80211_MAX_SSID_LEN]; 2914 u8 ssid[IEEE80211_MAX_SSID_LEN];
2900 u8 ssid_len, mesh_id_len, mesh_id_up_len; 2915 u8 ssid_len, mesh_id_len, mesh_id_up_len;
2901 enum {
2902 CFG80211_SME_IDLE,
2903 CFG80211_SME_CONNECTING,
2904 CFG80211_SME_CONNECTED,
2905 } sme_state;
2906 struct cfg80211_conn *conn; 2916 struct cfg80211_conn *conn;
2907 struct cfg80211_cached_keys *connect_keys; 2917 struct cfg80211_cached_keys *connect_keys;
2908 2918
@@ -3432,59 +3442,66 @@ void cfg80211_put_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
3432void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss); 3442void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
3433 3443
3434/** 3444/**
3435 * cfg80211_send_rx_auth - notification of processed authentication 3445 * cfg80211_rx_mlme_mgmt - notification of processed MLME management frame
3436 * @dev: network device 3446 * @dev: network device
3437 * @buf: authentication frame (header + body) 3447 * @buf: authentication frame (header + body)
3438 * @len: length of the frame data 3448 * @len: length of the frame data
3439 * 3449 *
3440 * This function is called whenever an authentication has been processed in 3450 * This function is called whenever an authentication, disassociation or
3441 * station mode. The driver is required to call either this function or 3451 * deauthentication frame has been received and processed in station mode.
3442 * cfg80211_send_auth_timeout() to indicate the result of cfg80211_ops::auth() 3452 * After being asked to authenticate via cfg80211_ops::auth() the driver must
3443 * call. This function may sleep. The caller must hold the corresponding wdev's 3453 * call either this function or cfg80211_auth_timeout().
3444 * mutex. 3454 * After being asked to associate via cfg80211_ops::assoc() the driver must
3455 * call either this function or cfg80211_auth_timeout().
3456 * While connected, the driver must calls this for received and processed
3457 * disassociation and deauthentication frames. If the frame couldn't be used
3458 * because it was unprotected, the driver must call the function
3459 * cfg80211_rx_unprot_mlme_mgmt() instead.
3460 *
3461 * This function may sleep. The caller must hold the corresponding wdev's mutex.
3445 */ 3462 */
3446void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len); 3463void cfg80211_rx_mlme_mgmt(struct net_device *dev, const u8 *buf, size_t len);
3447 3464
3448/** 3465/**
3449 * cfg80211_send_auth_timeout - notification of timed out authentication 3466 * cfg80211_auth_timeout - notification of timed out authentication
3450 * @dev: network device 3467 * @dev: network device
3451 * @addr: The MAC address of the device with which the authentication timed out 3468 * @addr: The MAC address of the device with which the authentication timed out
3452 * 3469 *
3453 * This function may sleep. The caller must hold the corresponding wdev's 3470 * This function may sleep. The caller must hold the corresponding wdev's
3454 * mutex. 3471 * mutex.
3455 */ 3472 */
3456void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr); 3473void cfg80211_auth_timeout(struct net_device *dev, const u8 *addr);
3457 3474
3458/** 3475/**
3459 * cfg80211_send_rx_assoc - notification of processed association 3476 * cfg80211_rx_assoc_resp - notification of processed association response
3460 * @dev: network device 3477 * @dev: network device
3461 * @bss: the BSS struct association was requested for, the struct reference 3478 * @bss: the BSS that association was requested with, ownership of the pointer
3462 * is owned by cfg80211 after this call 3479 * moves to cfg80211 in this call
3463 * @buf: (re)association response frame (header + body) 3480 * @buf: authentication frame (header + body)
3464 * @len: length of the frame data 3481 * @len: length of the frame data
3465 * 3482 *
3466 * This function is called whenever a (re)association response has been 3483 * After being asked to associate via cfg80211_ops::assoc() the driver must
3467 * processed in station mode. The driver is required to call either this 3484 * call either this function or cfg80211_auth_timeout().
3468 * function or cfg80211_send_assoc_timeout() to indicate the result of 3485 *
3469 * cfg80211_ops::assoc() call. This function may sleep. The caller must hold 3486 * This function may sleep. The caller must hold the corresponding wdev's mutex.
3470 * the corresponding wdev's mutex.
3471 */ 3487 */
3472void cfg80211_send_rx_assoc(struct net_device *dev, struct cfg80211_bss *bss, 3488void cfg80211_rx_assoc_resp(struct net_device *dev,
3489 struct cfg80211_bss *bss,
3473 const u8 *buf, size_t len); 3490 const u8 *buf, size_t len);
3474 3491
3475/** 3492/**
3476 * cfg80211_send_assoc_timeout - notification of timed out association 3493 * cfg80211_assoc_timeout - notification of timed out association
3477 * @dev: network device 3494 * @dev: network device
3478 * @addr: The MAC address of the device with which the association timed out 3495 * @addr: The MAC address of the device with which the association timed out
3479 * 3496 *
3480 * This function may sleep. The caller must hold the corresponding wdev's mutex. 3497 * This function may sleep. The caller must hold the corresponding wdev's mutex.
3481 */ 3498 */
3482void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr); 3499void cfg80211_assoc_timeout(struct net_device *dev, const u8 *addr);
3483 3500
3484/** 3501/**
3485 * cfg80211_send_deauth - notification of processed deauthentication 3502 * cfg80211_tx_mlme_mgmt - notification of transmitted deauth/disassoc frame
3486 * @dev: network device 3503 * @dev: network device
3487 * @buf: deauthentication frame (header + body) 3504 * @buf: 802.11 frame (header + body)
3488 * @len: length of the frame data 3505 * @len: length of the frame data
3489 * 3506 *
3490 * This function is called whenever deauthentication has been processed in 3507 * This function is called whenever deauthentication has been processed in
@@ -3492,46 +3509,20 @@ void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr);
3492 * locally generated ones. This function may sleep. The caller must hold the 3509 * locally generated ones. This function may sleep. The caller must hold the
3493 * corresponding wdev's mutex. 3510 * corresponding wdev's mutex.
3494 */ 3511 */
3495void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len); 3512void cfg80211_tx_mlme_mgmt(struct net_device *dev, const u8 *buf, size_t len);
3496
3497/**
3498 * cfg80211_send_disassoc - notification of processed disassociation
3499 * @dev: network device
3500 * @buf: disassociation response frame (header + body)
3501 * @len: length of the frame data
3502 *
3503 * This function is called whenever disassociation has been processed in
3504 * station mode. This includes both received disassociation frames and locally
3505 * generated ones. This function may sleep. The caller must hold the
3506 * corresponding wdev's mutex.
3507 */
3508void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len);
3509 3513
3510/** 3514/**
3511 * cfg80211_send_unprot_deauth - notification of unprotected deauthentication 3515 * cfg80211_rx_unprot_mlme_mgmt - notification of unprotected mlme mgmt frame
3512 * @dev: network device 3516 * @dev: network device
3513 * @buf: deauthentication frame (header + body) 3517 * @buf: deauthentication frame (header + body)
3514 * @len: length of the frame data 3518 * @len: length of the frame data
3515 * 3519 *
3516 * This function is called whenever a received Deauthentication frame has been 3520 * This function is called whenever a received deauthentication or dissassoc
3517 * dropped in station mode because of MFP being used but the Deauthentication 3521 * frame has been dropped in station mode because of MFP being used but the
3518 * frame was not protected. This function may sleep.
3519 */
3520void cfg80211_send_unprot_deauth(struct net_device *dev, const u8 *buf,
3521 size_t len);
3522
3523/**
3524 * cfg80211_send_unprot_disassoc - notification of unprotected disassociation
3525 * @dev: network device
3526 * @buf: disassociation frame (header + body)
3527 * @len: length of the frame data
3528 *
3529 * This function is called whenever a received Disassociation frame has been
3530 * dropped in station mode because of MFP being used but the Disassociation
3531 * frame was not protected. This function may sleep. 3522 * frame was not protected. This function may sleep.
3532 */ 3523 */
3533void cfg80211_send_unprot_disassoc(struct net_device *dev, const u8 *buf, 3524void cfg80211_rx_unprot_mlme_mgmt(struct net_device *dev,
3534 size_t len); 3525 const u8 *buf, size_t len);
3535 3526
3536/** 3527/**
3537 * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP) 3528 * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP)
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 1f0014bd4d87..a405a7a9775c 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -217,8 +217,8 @@ struct ieee80211_chanctx_conf {
217 * @BSS_CHANGED_TXPOWER: TX power setting changed for this interface 217 * @BSS_CHANGED_TXPOWER: TX power setting changed for this interface
218 * @BSS_CHANGED_P2P_PS: P2P powersave settings (CTWindow, opportunistic PS) 218 * @BSS_CHANGED_P2P_PS: P2P powersave settings (CTWindow, opportunistic PS)
219 * changed (currently only in P2P client mode, GO mode will be later) 219 * changed (currently only in P2P client mode, GO mode will be later)
220 * @BSS_CHANGED_DTIM_PERIOD: the DTIM period value was changed (set when 220 * @BSS_CHANGED_BEACON_INFO: Data from the AP's beacon became available:
221 * it becomes valid, managed mode only) 221 * currently dtim_period only is under consideration.
222 * @BSS_CHANGED_BANDWIDTH: The bandwidth used by this interface changed, 222 * @BSS_CHANGED_BANDWIDTH: The bandwidth used by this interface changed,
223 * note that this is only called when it changes after the channel 223 * note that this is only called when it changes after the channel
224 * context had been assigned. 224 * context had been assigned.
@@ -244,7 +244,7 @@ enum ieee80211_bss_change {
244 BSS_CHANGED_PS = 1<<17, 244 BSS_CHANGED_PS = 1<<17,
245 BSS_CHANGED_TXPOWER = 1<<18, 245 BSS_CHANGED_TXPOWER = 1<<18,
246 BSS_CHANGED_P2P_PS = 1<<19, 246 BSS_CHANGED_P2P_PS = 1<<19,
247 BSS_CHANGED_DTIM_PERIOD = 1<<20, 247 BSS_CHANGED_BEACON_INFO = 1<<20,
248 BSS_CHANGED_BANDWIDTH = 1<<21, 248 BSS_CHANGED_BANDWIDTH = 1<<21,
249 249
250 /* when adding here, make sure to change ieee80211_reconfig */ 250 /* when adding here, make sure to change ieee80211_reconfig */
@@ -288,7 +288,7 @@ enum ieee80211_rssi_event {
288 * IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE hardware flag 288 * IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE hardware flag
289 * @dtim_period: num of beacons before the next DTIM, for beaconing, 289 * @dtim_period: num of beacons before the next DTIM, for beaconing,
290 * valid in station mode only if after the driver was notified 290 * valid in station mode only if after the driver was notified
291 * with the %BSS_CHANGED_DTIM_PERIOD flag, will be non-zero then. 291 * with the %BSS_CHANGED_BEACON_INFO flag, will be non-zero then.
292 * @sync_tsf: last beacon's/probe response's TSF timestamp (could be old 292 * @sync_tsf: last beacon's/probe response's TSF timestamp (could be old
293 * as it may have been received during scanning long ago). If the 293 * as it may have been received during scanning long ago). If the
294 * HW flag %IEEE80211_HW_TIMING_BEACON_ONLY is set, then this can 294 * HW flag %IEEE80211_HW_TIMING_BEACON_ONLY is set, then this can
@@ -460,6 +460,8 @@ struct ieee80211_bss_conf {
460 * @IEEE80211_TX_CTL_DONTFRAG: Don't fragment this packet even if it 460 * @IEEE80211_TX_CTL_DONTFRAG: Don't fragment this packet even if it
461 * would be fragmented by size (this is optional, only used for 461 * would be fragmented by size (this is optional, only used for
462 * monitor injection). 462 * monitor injection).
463 * @IEEE80211_TX_CTL_PS_RESPONSE: This frame is a response to a poll
464 * frame (PS-Poll or uAPSD).
463 * 465 *
464 * Note: If you have to add new flags to the enumeration, then don't 466 * Note: If you have to add new flags to the enumeration, then don't
465 * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. 467 * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary.
@@ -495,6 +497,7 @@ enum mac80211_tx_control_flags {
495 IEEE80211_TX_STATUS_EOSP = BIT(28), 497 IEEE80211_TX_STATUS_EOSP = BIT(28),
496 IEEE80211_TX_CTL_USE_MINRATE = BIT(29), 498 IEEE80211_TX_CTL_USE_MINRATE = BIT(29),
497 IEEE80211_TX_CTL_DONTFRAG = BIT(30), 499 IEEE80211_TX_CTL_DONTFRAG = BIT(30),
500 IEEE80211_TX_CTL_PS_RESPONSE = BIT(31),
498}; 501};
499 502
500#define IEEE80211_TX_CTL_STBC_SHIFT 23 503#define IEEE80211_TX_CTL_STBC_SHIFT 23
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h
index b87a1692b086..0af851c3b038 100644
--- a/include/net/nfc/hci.h
+++ b/include/net/nfc/hci.h
@@ -59,8 +59,10 @@ struct nfc_hci_ops {
59 struct nfc_target *target); 59 struct nfc_target *target);
60 int (*event_received)(struct nfc_hci_dev *hdev, u8 gate, u8 event, 60 int (*event_received)(struct nfc_hci_dev *hdev, u8 gate, u8 event,
61 struct sk_buff *skb); 61 struct sk_buff *skb);
62 int (*enable_se)(struct nfc_dev *dev, u32 secure_element); 62 int (*fw_upload)(struct nfc_hci_dev *hdev, const char *firmware_name);
63 int (*disable_se)(struct nfc_dev *dev, u32 secure_element); 63 int (*discover_se)(struct nfc_hci_dev *dev);
64 int (*enable_se)(struct nfc_hci_dev *dev, u32 se_idx);
65 int (*disable_se)(struct nfc_hci_dev *dev, u32 se_idx);
64}; 66};
65 67
66/* Pipes */ 68/* Pipes */
@@ -152,7 +154,6 @@ struct nfc_hci_dev *nfc_hci_allocate_device(struct nfc_hci_ops *ops,
152 struct nfc_hci_init_data *init_data, 154 struct nfc_hci_init_data *init_data,
153 unsigned long quirks, 155 unsigned long quirks,
154 u32 protocols, 156 u32 protocols,
155 u32 supported_se,
156 const char *llc_name, 157 const char *llc_name,
157 int tx_headroom, 158 int tx_headroom,
158 int tx_tailroom, 159 int tx_tailroom,
diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h
index 5bc0c460edc0..99fc1f3a392a 100644
--- a/include/net/nfc/nci_core.h
+++ b/include/net/nfc/nci_core.h
@@ -3,6 +3,7 @@
3 * NFC Controller (NFCC) and a Device Host (DH). 3 * NFC Controller (NFCC) and a Device Host (DH).
4 * 4 *
5 * Copyright (C) 2011 Texas Instruments, Inc. 5 * Copyright (C) 2011 Texas Instruments, Inc.
6 * Copyright (C) 2013 Intel Corporation. All rights reserved.
6 * 7 *
7 * Written by Ilan Elias <ilane@ti.com> 8 * Written by Ilan Elias <ilane@ti.com>
8 * 9 *
@@ -66,7 +67,7 @@ struct nci_dev;
66struct nci_ops { 67struct nci_ops {
67 int (*open)(struct nci_dev *ndev); 68 int (*open)(struct nci_dev *ndev);
68 int (*close)(struct nci_dev *ndev); 69 int (*close)(struct nci_dev *ndev);
69 int (*send)(struct sk_buff *skb); 70 int (*send)(struct nci_dev *ndev, struct sk_buff *skb);
70}; 71};
71 72
72#define NCI_MAX_SUPPORTED_RF_INTERFACES 4 73#define NCI_MAX_SUPPORTED_RF_INTERFACES 4
@@ -147,13 +148,12 @@ struct nci_dev {
147/* ----- NCI Devices ----- */ 148/* ----- NCI Devices ----- */
148struct nci_dev *nci_allocate_device(struct nci_ops *ops, 149struct nci_dev *nci_allocate_device(struct nci_ops *ops,
149 __u32 supported_protocols, 150 __u32 supported_protocols,
150 __u32 supported_se,
151 int tx_headroom, 151 int tx_headroom,
152 int tx_tailroom); 152 int tx_tailroom);
153void nci_free_device(struct nci_dev *ndev); 153void nci_free_device(struct nci_dev *ndev);
154int nci_register_device(struct nci_dev *ndev); 154int nci_register_device(struct nci_dev *ndev);
155void nci_unregister_device(struct nci_dev *ndev); 155void nci_unregister_device(struct nci_dev *ndev);
156int nci_recv_frame(struct sk_buff *skb); 156int nci_recv_frame(struct nci_dev *ndev, struct sk_buff *skb);
157 157
158static inline struct sk_buff *nci_skb_alloc(struct nci_dev *ndev, 158static inline struct sk_buff *nci_skb_alloc(struct nci_dev *ndev,
159 unsigned int len, 159 unsigned int len,
@@ -202,4 +202,56 @@ void nci_req_complete(struct nci_dev *ndev, int result);
202/* ----- NCI status code ----- */ 202/* ----- NCI status code ----- */
203int nci_to_errno(__u8 code); 203int nci_to_errno(__u8 code);
204 204
205/* ----- NCI over SPI acknowledge modes ----- */
206#define NCI_SPI_CRC_DISABLED 0x00
207#define NCI_SPI_CRC_ENABLED 0x01
208
209/* ----- NCI SPI structures ----- */
210struct nci_spi_dev;
211
212struct nci_spi_ops {
213 int (*open)(struct nci_spi_dev *ndev);
214 int (*close)(struct nci_spi_dev *ndev);
215 void (*assert_int)(struct nci_spi_dev *ndev);
216 void (*deassert_int)(struct nci_spi_dev *ndev);
217};
218
219struct nci_spi_dev {
220 struct nci_dev *nci_dev;
221 struct spi_device *spi;
222 struct nci_spi_ops *ops;
223
224 unsigned int xfer_udelay; /* microseconds delay between
225 transactions */
226 u8 acknowledge_mode;
227
228 struct completion req_completion;
229 u8 req_result;
230
231 void *driver_data;
232};
233
234/* ----- NCI SPI Devices ----- */
235struct nci_spi_dev *nci_spi_allocate_device(struct spi_device *spi,
236 struct nci_spi_ops *ops,
237 u32 supported_protocols,
238 u32 supported_se,
239 u8 acknowledge_mode,
240 unsigned int delay);
241void nci_spi_free_device(struct nci_spi_dev *ndev);
242int nci_spi_register_device(struct nci_spi_dev *ndev);
243void nci_spi_unregister_device(struct nci_spi_dev *ndev);
244int nci_spi_recv_frame(struct nci_spi_dev *ndev);
245
246static inline void nci_spi_set_drvdata(struct nci_spi_dev *ndev,
247 void *data)
248{
249 ndev->driver_data = data;
250}
251
252static inline void *nci_spi_get_drvdata(struct nci_spi_dev *ndev)
253{
254 return ndev->driver_data;
255}
256
205#endif /* __NCI_CORE_H */ 257#endif /* __NCI_CORE_H */
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h
index 5eb80bb3cbb2..0e353f1658bb 100644
--- a/include/net/nfc/nfc.h
+++ b/include/net/nfc/nfc.h
@@ -68,8 +68,12 @@ struct nfc_ops {
68 void *cb_context); 68 void *cb_context);
69 int (*tm_send)(struct nfc_dev *dev, struct sk_buff *skb); 69 int (*tm_send)(struct nfc_dev *dev, struct sk_buff *skb);
70 int (*check_presence)(struct nfc_dev *dev, struct nfc_target *target); 70 int (*check_presence)(struct nfc_dev *dev, struct nfc_target *target);
71 int (*enable_se)(struct nfc_dev *dev, u32 secure_element); 71 int (*fw_upload)(struct nfc_dev *dev, const char *firmware_name);
72 int (*disable_se)(struct nfc_dev *dev, u32 secure_element); 72
73 /* Secure Element API */
74 int (*discover_se)(struct nfc_dev *dev);
75 int (*enable_se)(struct nfc_dev *dev, u32 se_idx);
76 int (*disable_se)(struct nfc_dev *dev, u32 se_idx);
73}; 77};
74 78
75#define NFC_TARGET_IDX_ANY -1 79#define NFC_TARGET_IDX_ANY -1
@@ -83,6 +87,8 @@ struct nfc_target {
83 u8 sel_res; 87 u8 sel_res;
84 u8 nfcid1_len; 88 u8 nfcid1_len;
85 u8 nfcid1[NFC_NFCID1_MAXSIZE]; 89 u8 nfcid1[NFC_NFCID1_MAXSIZE];
90 u8 nfcid2_len;
91 u8 nfcid2[NFC_NFCID2_MAXSIZE];
86 u8 sensb_res_len; 92 u8 sensb_res_len;
87 u8 sensb_res[NFC_SENSB_RES_MAXSIZE]; 93 u8 sensb_res[NFC_SENSB_RES_MAXSIZE];
88 u8 sensf_res_len; 94 u8 sensf_res_len;
@@ -91,6 +97,23 @@ struct nfc_target {
91 u8 logical_idx; 97 u8 logical_idx;
92}; 98};
93 99
100/**
101 * nfc_se - A structure for NFC accessible secure elements.
102 *
103 * @idx: The secure element index. User space will enable or
104 * disable a secure element by its index.
105 * @type: The secure element type. It can be SE_UICC or
106 * SE_EMBEDDED.
107 * @state: The secure element state, either enabled or disabled.
108 *
109 */
110struct nfc_se {
111 struct list_head list;
112 u32 idx;
113 u16 type;
114 u16 state;
115};
116
94struct nfc_genl_data { 117struct nfc_genl_data {
95 u32 poll_req_portid; 118 u32 poll_req_portid;
96 struct mutex genl_data_mutex; 119 struct mutex genl_data_mutex;
@@ -104,6 +127,7 @@ struct nfc_dev {
104 int targets_generation; 127 int targets_generation;
105 struct device dev; 128 struct device dev;
106 bool dev_up; 129 bool dev_up;
130 bool fw_upload_in_progress;
107 u8 rf_mode; 131 u8 rf_mode;
108 bool polling; 132 bool polling;
109 struct nfc_target *active_target; 133 struct nfc_target *active_target;
@@ -111,8 +135,7 @@ struct nfc_dev {
111 struct nfc_genl_data genl_data; 135 struct nfc_genl_data genl_data;
112 u32 supported_protocols; 136 u32 supported_protocols;
113 137
114 u32 supported_se; 138 struct list_head secure_elements;
115 u32 active_se;
116 139
117 int tx_headroom; 140 int tx_headroom;
118 int tx_tailroom; 141 int tx_tailroom;
@@ -132,7 +155,6 @@ extern struct class nfc_class;
132 155
133struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops, 156struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops,
134 u32 supported_protocols, 157 u32 supported_protocols,
135 u32 supported_se,
136 int tx_headroom, 158 int tx_headroom,
137 int tx_tailroom); 159 int tx_tailroom);
138 160
@@ -216,4 +238,7 @@ int nfc_tm_data_received(struct nfc_dev *dev, struct sk_buff *skb);
216 238
217void nfc_driver_failure(struct nfc_dev *dev, int err); 239void nfc_driver_failure(struct nfc_dev *dev, int err);
218 240
241int nfc_add_se(struct nfc_dev *dev, u32 se_idx, u16 type);
242int nfc_remove_se(struct nfc_dev *dev, u32 se_idx);
243
219#endif /* __NET_NFC_H */ 244#endif /* __NET_NFC_H */
diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h
index 7c6f627a717d..caed0f324d5f 100644
--- a/include/uapi/linux/nfc.h
+++ b/include/uapi/linux/nfc.h
@@ -69,6 +69,8 @@
69 * starting a poll from a device which has a secure element enabled means 69 * starting a poll from a device which has a secure element enabled means
70 * we want to do SE based card emulation. 70 * we want to do SE based card emulation.
71 * @NFC_CMD_DISABLE_SE: Disable the physical link to a specific secure element. 71 * @NFC_CMD_DISABLE_SE: Disable the physical link to a specific secure element.
72 * @NFC_CMD_FW_UPLOAD: Request to Load/flash firmware, or event to inform that
73 * some firmware was loaded
72 */ 74 */
73enum nfc_commands { 75enum nfc_commands {
74 NFC_CMD_UNSPEC, 76 NFC_CMD_UNSPEC,
@@ -92,6 +94,9 @@ enum nfc_commands {
92 NFC_CMD_DISABLE_SE, 94 NFC_CMD_DISABLE_SE,
93 NFC_CMD_LLC_SDREQ, 95 NFC_CMD_LLC_SDREQ,
94 NFC_EVENT_LLC_SDRES, 96 NFC_EVENT_LLC_SDRES,
97 NFC_CMD_FW_UPLOAD,
98 NFC_EVENT_SE_ADDED,
99 NFC_EVENT_SE_REMOVED,
95/* private: internal use only */ 100/* private: internal use only */
96 __NFC_CMD_AFTER_LAST 101 __NFC_CMD_AFTER_LAST
97}; 102};
@@ -121,6 +126,9 @@ enum nfc_commands {
121 * @NFC_ATTR_LLC_PARAM_RW: Receive Window size parameter 126 * @NFC_ATTR_LLC_PARAM_RW: Receive Window size parameter
122 * @NFC_ATTR_LLC_PARAM_MIUX: MIU eXtension parameter 127 * @NFC_ATTR_LLC_PARAM_MIUX: MIU eXtension parameter
123 * @NFC_ATTR_SE: Available Secure Elements 128 * @NFC_ATTR_SE: Available Secure Elements
129 * @NFC_ATTR_FIRMWARE_NAME: Free format firmware version
130 * @NFC_ATTR_SE_INDEX: Secure element index
131 * @NFC_ATTR_SE_TYPE: Secure element type (UICC or EMBEDDED)
124 */ 132 */
125enum nfc_attrs { 133enum nfc_attrs {
126 NFC_ATTR_UNSPEC, 134 NFC_ATTR_UNSPEC,
@@ -143,6 +151,9 @@ enum nfc_attrs {
143 NFC_ATTR_LLC_PARAM_MIUX, 151 NFC_ATTR_LLC_PARAM_MIUX,
144 NFC_ATTR_SE, 152 NFC_ATTR_SE,
145 NFC_ATTR_LLC_SDP, 153 NFC_ATTR_LLC_SDP,
154 NFC_ATTR_FIRMWARE_NAME,
155 NFC_ATTR_SE_INDEX,
156 NFC_ATTR_SE_TYPE,
146/* private: internal use only */ 157/* private: internal use only */
147 __NFC_ATTR_AFTER_LAST 158 __NFC_ATTR_AFTER_LAST
148}; 159};
@@ -159,9 +170,12 @@ enum nfc_sdp_attr {
159 170
160#define NFC_DEVICE_NAME_MAXSIZE 8 171#define NFC_DEVICE_NAME_MAXSIZE 8
161#define NFC_NFCID1_MAXSIZE 10 172#define NFC_NFCID1_MAXSIZE 10
173#define NFC_NFCID2_MAXSIZE 8
174#define NFC_NFCID3_MAXSIZE 10
162#define NFC_SENSB_RES_MAXSIZE 12 175#define NFC_SENSB_RES_MAXSIZE 12
163#define NFC_SENSF_RES_MAXSIZE 18 176#define NFC_SENSF_RES_MAXSIZE 18
164#define NFC_GB_MAXSIZE 48 177#define NFC_GB_MAXSIZE 48
178#define NFC_FIRMWARE_NAME_MAXSIZE 32
165 179
166/* NFC protocols */ 180/* NFC protocols */
167#define NFC_PROTO_JEWEL 1 181#define NFC_PROTO_JEWEL 1
@@ -191,10 +205,12 @@ enum nfc_sdp_attr {
191#define NFC_PROTO_ISO14443_B_MASK (1 << NFC_PROTO_ISO14443_B) 205#define NFC_PROTO_ISO14443_B_MASK (1 << NFC_PROTO_ISO14443_B)
192 206
193/* NFC Secure Elements */ 207/* NFC Secure Elements */
194#define NFC_SE_NONE 0x0
195#define NFC_SE_UICC 0x1 208#define NFC_SE_UICC 0x1
196#define NFC_SE_EMBEDDED 0x2 209#define NFC_SE_EMBEDDED 0x2
197 210
211#define NFC_SE_DISABLED 0x0
212#define NFC_SE_ENABLED 0x1
213
198struct sockaddr_nfc { 214struct sockaddr_nfc {
199 sa_family_t sa_family; 215 sa_family_t sa_family;
200 __u32 dev_idx; 216 __u32 dev_idx;
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 5920715278c2..ca6facf4df0c 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -2577,6 +2577,10 @@ enum nl80211_mesh_power_mode {
2577 * 2577 *
2578 * @NL80211_MESHCONF_AWAKE_WINDOW: awake window duration (in TUs) 2578 * @NL80211_MESHCONF_AWAKE_WINDOW: awake window duration (in TUs)
2579 * 2579 *
2580 * @NL80211_MESHCONF_PLINK_TIMEOUT: If no tx activity is seen from a STA we've
2581 * established peering with for longer than this time (in seconds), then
2582 * remove it from the STA's list of peers. Default is 30 minutes.
2583 *
2580 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use 2584 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
2581 */ 2585 */
2582enum nl80211_meshconf_params { 2586enum nl80211_meshconf_params {
@@ -2608,6 +2612,7 @@ enum nl80211_meshconf_params {
2608 NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL, 2612 NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL,
2609 NL80211_MESHCONF_POWER_MODE, 2613 NL80211_MESHCONF_POWER_MODE,
2610 NL80211_MESHCONF_AWAKE_WINDOW, 2614 NL80211_MESHCONF_AWAKE_WINDOW,
2615 NL80211_MESHCONF_PLINK_TIMEOUT,
2611 2616
2612 /* keep last */ 2617 /* keep last */
2613 __NL80211_MESHCONF_ATTR_AFTER_LAST, 2618 __NL80211_MESHCONF_ATTR_AFTER_LAST,
@@ -3579,6 +3584,10 @@ enum nl80211_ap_sme_features {
3579 * Peering Management entity which may be implemented by registering for 3584 * Peering Management entity which may be implemented by registering for
3580 * beacons or NL80211_CMD_NEW_PEER_CANDIDATE events. The mesh beacon is 3585 * beacons or NL80211_CMD_NEW_PEER_CANDIDATE events. The mesh beacon is
3581 * still generated by the driver. 3586 * still generated by the driver.
3587 * @NL80211_FEATURE_ACTIVE_MONITOR: This driver supports an active monitor
3588 * interface. An active monitor interface behaves like a normal monitor
3589 * interface, but gets added to the driver. It ensures that incoming
3590 * unicast packets directed at the configured interface address get ACKed.
3582 */ 3591 */
3583enum nl80211_feature_flags { 3592enum nl80211_feature_flags {
3584 NL80211_FEATURE_SK_TX_STATUS = 1 << 0, 3593 NL80211_FEATURE_SK_TX_STATUS = 1 << 0,