aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2012-01-05 10:12:45 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-01-05 10:13:24 -0500
commit1032c736e81cdf490ae62f86da7efe67c3c3e61d (patch)
treea0c3919849f97dbbc5ea7c6a9ac1d7a639e44a73 /net
parent117ff42fd43e92d24c6aa6f3e4f0f1e1edada140 (diff)
parentcb00ec382b57d35b955c085198cd54a0c1fcdc94 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Conflicts: drivers/net/wireless/b43legacy/dma.c
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/ieee80211_i.h2
-rw-r--r--net/mac80211/mlme.c2
-rw-r--r--net/mac80211/offchannel.c21
-rw-r--r--net/mac80211/rx.c20
-rw-r--r--net/mac80211/scan.c2
-rw-r--r--net/mac80211/sta_info.c5
-rw-r--r--net/mac80211/util.c19
-rw-r--r--net/nfc/nci/core.c22
-rw-r--r--net/nfc/nci/lib.c3
-rw-r--r--net/nfc/nci/ntf.c50
-rw-r--r--net/nfc/nci/rsp.c10
-rw-r--r--net/nfc/netlink.c3
-rw-r--r--net/rfkill/rfkill-gpio.c2
-rw-r--r--net/wireless/genregdb.awk13
-rw-r--r--net/wireless/reg.c40
-rw-r--r--net/wireless/reg.h15
-rw-r--r--net/wireless/regdb.h16
-rw-r--r--net/wireless/util.c6
18 files changed, 149 insertions, 102 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index c3f3e431a573..2f0642d9e154 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1221,8 +1221,6 @@ int ieee80211_request_sched_scan_stop(struct ieee80211_sub_if_data *sdata);
1221void ieee80211_sched_scan_stopped_work(struct work_struct *work); 1221void ieee80211_sched_scan_stopped_work(struct work_struct *work);
1222 1222
1223/* off-channel helpers */ 1223/* off-channel helpers */
1224void ieee80211_offchannel_enable_all_ps(struct ieee80211_local *local,
1225 bool tell_ap);
1226void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local, 1224void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local,
1227 bool offchannel_ps_enable); 1225 bool offchannel_ps_enable);
1228void ieee80211_offchannel_return(struct ieee80211_local *local, 1226void ieee80211_offchannel_return(struct ieee80211_local *local,
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 57989a046fca..ecb4c84c1bb3 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1385,9 +1385,11 @@ void ieee80211_beacon_connection_loss_work(struct work_struct *work)
1385 struct sta_info *sta; 1385 struct sta_info *sta;
1386 1386
1387 if (ifmgd->associated) { 1387 if (ifmgd->associated) {
1388 rcu_read_lock();
1388 sta = sta_info_get(sdata, ifmgd->bssid); 1389 sta = sta_info_get(sdata, ifmgd->bssid);
1389 if (sta) 1390 if (sta)
1390 sta->beacon_loss_count++; 1391 sta->beacon_loss_count++;
1392 rcu_read_unlock();
1391 } 1393 }
1392 1394
1393 if (sdata->local->hw.flags & IEEE80211_HW_CONNECTION_MONITOR) 1395 if (sdata->local->hw.flags & IEEE80211_HW_CONNECTION_MONITOR)
diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c
index e4330d843575..f054e94901a2 100644
--- a/net/mac80211/offchannel.c
+++ b/net/mac80211/offchannel.c
@@ -138,23 +138,6 @@ void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local,
138 mutex_unlock(&local->iflist_mtx); 138 mutex_unlock(&local->iflist_mtx);
139} 139}
140 140
141void ieee80211_offchannel_enable_all_ps(struct ieee80211_local *local,
142 bool tell_ap)
143{
144 struct ieee80211_sub_if_data *sdata;
145
146 mutex_lock(&local->iflist_mtx);
147 list_for_each_entry(sdata, &local->interfaces, list) {
148 if (!ieee80211_sdata_running(sdata))
149 continue;
150
151 if (sdata->vif.type == NL80211_IFTYPE_STATION &&
152 sdata->u.mgd.associated)
153 ieee80211_offchannel_ps_enable(sdata, tell_ap);
154 }
155 mutex_unlock(&local->iflist_mtx);
156}
157
158void ieee80211_offchannel_return(struct ieee80211_local *local, 141void ieee80211_offchannel_return(struct ieee80211_local *local,
159 bool offchannel_ps_disable) 142 bool offchannel_ps_disable)
160{ 143{
@@ -162,6 +145,9 @@ void ieee80211_offchannel_return(struct ieee80211_local *local,
162 145
163 mutex_lock(&local->iflist_mtx); 146 mutex_lock(&local->iflist_mtx);
164 list_for_each_entry(sdata, &local->interfaces, list) { 147 list_for_each_entry(sdata, &local->interfaces, list) {
148 if (sdata->vif.type != NL80211_IFTYPE_MONITOR)
149 clear_bit(SDATA_STATE_OFFCHANNEL, &sdata->state);
150
165 if (!ieee80211_sdata_running(sdata)) 151 if (!ieee80211_sdata_running(sdata))
166 continue; 152 continue;
167 153
@@ -173,7 +159,6 @@ void ieee80211_offchannel_return(struct ieee80211_local *local,
173 } 159 }
174 160
175 if (sdata->vif.type != NL80211_IFTYPE_MONITOR) { 161 if (sdata->vif.type != NL80211_IFTYPE_MONITOR) {
176 clear_bit(SDATA_STATE_OFFCHANNEL, &sdata->state);
177 /* 162 /*
178 * This may wake up queues even though the driver 163 * This may wake up queues even though the driver
179 * currently has them stopped. This is not very 164 * currently has them stopped. This is not very
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 59f124c58333..f407427c642f 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1576,25 +1576,6 @@ ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
1576 return RX_CONTINUE; 1576 return RX_CONTINUE;
1577} 1577}
1578 1578
1579static ieee80211_rx_result debug_noinline
1580ieee80211_rx_h_remove_qos_control(struct ieee80211_rx_data *rx)
1581{
1582 u8 *data = rx->skb->data;
1583 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)data;
1584
1585 if (!ieee80211_is_data_qos(hdr->frame_control))
1586 return RX_CONTINUE;
1587
1588 /* remove the qos control field, update frame type and meta-data */
1589 memmove(data + IEEE80211_QOS_CTL_LEN, data,
1590 ieee80211_hdrlen(hdr->frame_control) - IEEE80211_QOS_CTL_LEN);
1591 hdr = (struct ieee80211_hdr *)skb_pull(rx->skb, IEEE80211_QOS_CTL_LEN);
1592 /* change frame type to non QOS */
1593 hdr->frame_control &= ~cpu_to_le16(IEEE80211_STYPE_QOS_DATA);
1594
1595 return RX_CONTINUE;
1596}
1597
1598static int 1579static int
1599ieee80211_802_1x_port_control(struct ieee80211_rx_data *rx) 1580ieee80211_802_1x_port_control(struct ieee80211_rx_data *rx)
1600{ 1581{
@@ -2718,7 +2699,6 @@ static void ieee80211_rx_handlers(struct ieee80211_rx_data *rx)
2718 if (ieee80211_vif_is_mesh(&rx->sdata->vif)) 2699 if (ieee80211_vif_is_mesh(&rx->sdata->vif))
2719 CALL_RXH(ieee80211_rx_h_mesh_fwding); 2700 CALL_RXH(ieee80211_rx_h_mesh_fwding);
2720#endif 2701#endif
2721 CALL_RXH(ieee80211_rx_h_remove_qos_control)
2722 CALL_RXH(ieee80211_rx_h_amsdu) 2702 CALL_RXH(ieee80211_rx_h_amsdu)
2723 CALL_RXH(ieee80211_rx_h_data) 2703 CALL_RXH(ieee80211_rx_h_data)
2724 CALL_RXH(ieee80211_rx_h_ctrl); 2704 CALL_RXH(ieee80211_rx_h_ctrl);
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 2c9b493af249..9270771702fe 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -625,7 +625,7 @@ static void ieee80211_scan_state_resume(struct ieee80211_local *local,
625 local->leave_oper_channel_time = jiffies; 625 local->leave_oper_channel_time = jiffies;
626 626
627 /* advance to the next channel to be scanned */ 627 /* advance to the next channel to be scanned */
628 local->next_scan_state = SCAN_DECISION; 628 local->next_scan_state = SCAN_SET_CHANNEL;
629} 629}
630 630
631void ieee80211_scan_work(struct work_struct *work) 631void ieee80211_scan_work(struct work_struct *work)
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index f0d3b483dabd..b197136aea2c 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -945,7 +945,8 @@ void ieee80211_sta_expire(struct ieee80211_sub_if_data *sdata,
945 struct sta_info *sta, *tmp; 945 struct sta_info *sta, *tmp;
946 946
947 mutex_lock(&local->sta_mtx); 947 mutex_lock(&local->sta_mtx);
948 list_for_each_entry_safe(sta, tmp, &local->sta_list, list) 948
949 list_for_each_entry_safe(sta, tmp, &local->sta_list, list) {
949 if (sdata != sta->sdata) 950 if (sdata != sta->sdata)
950 continue; 951 continue;
951 952
@@ -956,6 +957,8 @@ void ieee80211_sta_expire(struct ieee80211_sub_if_data *sdata,
956#endif 957#endif
957 WARN_ON(__sta_info_destroy(sta)); 958 WARN_ON(__sta_info_destroy(sta));
958 } 959 }
960 }
961
959 mutex_unlock(&local->sta_mtx); 962 mutex_unlock(&local->sta_mtx);
960} 963}
961 964
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index eb1a5f737a9c..9919892575f4 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1142,16 +1142,6 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1142 */ 1142 */
1143 } 1143 }
1144#endif 1144#endif
1145
1146 /* setup fragmentation threshold */
1147 drv_set_frag_threshold(local, hw->wiphy->frag_threshold);
1148
1149 /* setup RTS threshold */
1150 drv_set_rts_threshold(local, hw->wiphy->rts_threshold);
1151
1152 /* reset coverage class */
1153 drv_set_coverage_class(local, hw->wiphy->coverage_class);
1154
1155 /* everything else happens only if HW was up & running */ 1145 /* everything else happens only if HW was up & running */
1156 if (!local->open_count) 1146 if (!local->open_count)
1157 goto wake_up; 1147 goto wake_up;
@@ -1170,6 +1160,15 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1170 return res; 1160 return res;
1171 } 1161 }
1172 1162
1163 /* setup fragmentation threshold */
1164 drv_set_frag_threshold(local, hw->wiphy->frag_threshold);
1165
1166 /* setup RTS threshold */
1167 drv_set_rts_threshold(local, hw->wiphy->rts_threshold);
1168
1169 /* reset coverage class */
1170 drv_set_coverage_class(local, hw->wiphy->coverage_class);
1171
1173 ieee80211_led_radio(local, true); 1172 ieee80211_led_radio(local, true);
1174 ieee80211_mod_tpt_led_trig(local, 1173 ieee80211_mod_tpt_led_trig(local,
1175 IEEE80211_TPT_LEDTRIG_FL_RADIO, 0); 1174 IEEE80211_TPT_LEDTRIG_FL_RADIO, 0);
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index 2deb4aebf568..7650139a1a05 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -154,14 +154,16 @@ static void nci_init_complete_req(struct nci_dev *ndev, unsigned long opt)
154 if (ndev->supported_rf_interfaces[i] == 154 if (ndev->supported_rf_interfaces[i] ==
155 NCI_RF_INTERFACE_ISO_DEP) { 155 NCI_RF_INTERFACE_ISO_DEP) {
156 cfg[*num].rf_protocol = NCI_RF_PROTOCOL_ISO_DEP; 156 cfg[*num].rf_protocol = NCI_RF_PROTOCOL_ISO_DEP;
157 cfg[*num].mode = NCI_DISC_MAP_MODE_BOTH; 157 cfg[*num].mode = NCI_DISC_MAP_MODE_POLL |
158 cfg[*num].rf_interface_type = NCI_RF_INTERFACE_ISO_DEP; 158 NCI_DISC_MAP_MODE_LISTEN;
159 cfg[*num].rf_interface = NCI_RF_INTERFACE_ISO_DEP;
159 (*num)++; 160 (*num)++;
160 } else if (ndev->supported_rf_interfaces[i] == 161 } else if (ndev->supported_rf_interfaces[i] ==
161 NCI_RF_INTERFACE_NFC_DEP) { 162 NCI_RF_INTERFACE_NFC_DEP) {
162 cfg[*num].rf_protocol = NCI_RF_PROTOCOL_NFC_DEP; 163 cfg[*num].rf_protocol = NCI_RF_PROTOCOL_NFC_DEP;
163 cfg[*num].mode = NCI_DISC_MAP_MODE_BOTH; 164 cfg[*num].mode = NCI_DISC_MAP_MODE_POLL |
164 cfg[*num].rf_interface_type = NCI_RF_INTERFACE_NFC_DEP; 165 NCI_DISC_MAP_MODE_LISTEN;
166 cfg[*num].rf_interface = NCI_RF_INTERFACE_NFC_DEP;
165 (*num)++; 167 (*num)++;
166 } 168 }
167 169
@@ -186,16 +188,16 @@ static void nci_rf_discover_req(struct nci_dev *ndev, unsigned long opt)
186 || protocols & NFC_PROTO_MIFARE_MASK 188 || protocols & NFC_PROTO_MIFARE_MASK
187 || protocols & NFC_PROTO_ISO14443_MASK 189 || protocols & NFC_PROTO_ISO14443_MASK
188 || protocols & NFC_PROTO_NFC_DEP_MASK)) { 190 || protocols & NFC_PROTO_NFC_DEP_MASK)) {
189 cmd.disc_configs[cmd.num_disc_configs].type = 191 cmd.disc_configs[cmd.num_disc_configs].rf_tech_and_mode =
190 NCI_DISCOVERY_TYPE_POLL_A_PASSIVE; 192 NCI_NFC_A_PASSIVE_POLL_MODE;
191 cmd.disc_configs[cmd.num_disc_configs].frequency = 1; 193 cmd.disc_configs[cmd.num_disc_configs].frequency = 1;
192 cmd.num_disc_configs++; 194 cmd.num_disc_configs++;
193 } 195 }
194 196
195 if ((cmd.num_disc_configs < NCI_MAX_NUM_RF_CONFIGS) && 197 if ((cmd.num_disc_configs < NCI_MAX_NUM_RF_CONFIGS) &&
196 (protocols & NFC_PROTO_ISO14443_MASK)) { 198 (protocols & NFC_PROTO_ISO14443_MASK)) {
197 cmd.disc_configs[cmd.num_disc_configs].type = 199 cmd.disc_configs[cmd.num_disc_configs].rf_tech_and_mode =
198 NCI_DISCOVERY_TYPE_POLL_B_PASSIVE; 200 NCI_NFC_B_PASSIVE_POLL_MODE;
199 cmd.disc_configs[cmd.num_disc_configs].frequency = 1; 201 cmd.disc_configs[cmd.num_disc_configs].frequency = 1;
200 cmd.num_disc_configs++; 202 cmd.num_disc_configs++;
201 } 203 }
@@ -203,8 +205,8 @@ static void nci_rf_discover_req(struct nci_dev *ndev, unsigned long opt)
203 if ((cmd.num_disc_configs < NCI_MAX_NUM_RF_CONFIGS) && 205 if ((cmd.num_disc_configs < NCI_MAX_NUM_RF_CONFIGS) &&
204 (protocols & NFC_PROTO_FELICA_MASK 206 (protocols & NFC_PROTO_FELICA_MASK
205 || protocols & NFC_PROTO_NFC_DEP_MASK)) { 207 || protocols & NFC_PROTO_NFC_DEP_MASK)) {
206 cmd.disc_configs[cmd.num_disc_configs].type = 208 cmd.disc_configs[cmd.num_disc_configs].rf_tech_and_mode =
207 NCI_DISCOVERY_TYPE_POLL_F_PASSIVE; 209 NCI_NFC_F_PASSIVE_POLL_MODE;
208 cmd.disc_configs[cmd.num_disc_configs].frequency = 1; 210 cmd.disc_configs[cmd.num_disc_configs].frequency = 1;
209 cmd.num_disc_configs++; 211 cmd.num_disc_configs++;
210 } 212 }
diff --git a/net/nfc/nci/lib.c b/net/nfc/nci/lib.c
index e99adcfb1bcf..6a63e5eb483d 100644
--- a/net/nfc/nci/lib.c
+++ b/net/nfc/nci/lib.c
@@ -77,9 +77,6 @@ int nci_to_errno(__u8 code)
77 case NCI_STATUS_NFCEE_TIMEOUT_ERROR: 77 case NCI_STATUS_NFCEE_TIMEOUT_ERROR:
78 return -ETIMEDOUT; 78 return -ETIMEDOUT;
79 79
80 case NCI_STATUS_MAX_ACTIVE_NFCEE_INTERFACES_REACHED:
81 return -EDQUOT;
82
83 case NCI_STATUS_FAILED: 80 case NCI_STATUS_FAILED:
84 default: 81 default:
85 return -ENOSYS; 82 return -ENOSYS;
diff --git a/net/nfc/nci/ntf.c b/net/nfc/nci/ntf.c
index 003846b2c326..b16a8dc2afbe 100644
--- a/net/nfc/nci/ntf.c
+++ b/net/nfc/nci/ntf.c
@@ -52,6 +52,9 @@ static void nci_core_conn_credits_ntf_packet(struct nci_dev *ndev,
52 52
53 /* update the credits */ 53 /* update the credits */
54 for (i = 0; i < ntf->num_entries; i++) { 54 for (i = 0; i < ntf->num_entries; i++) {
55 ntf->conn_entries[i].conn_id =
56 nci_conn_id(&ntf->conn_entries[i].conn_id);
57
55 pr_debug("entry[%d]: conn_id %d, credits %d\n", 58 pr_debug("entry[%d]: conn_id %d, credits %d\n",
56 i, ntf->conn_entries[i].conn_id, 59 i, ntf->conn_entries[i].conn_id,
57 ntf->conn_entries[i].credits); 60 ntf->conn_entries[i].credits);
@@ -68,6 +71,20 @@ static void nci_core_conn_credits_ntf_packet(struct nci_dev *ndev,
68 queue_work(ndev->tx_wq, &ndev->tx_work); 71 queue_work(ndev->tx_wq, &ndev->tx_work);
69} 72}
70 73
74static void nci_core_conn_intf_error_ntf_packet(struct nci_dev *ndev,
75 struct sk_buff *skb)
76{
77 struct nci_core_intf_error_ntf *ntf = (void *) skb->data;
78
79 ntf->conn_id = nci_conn_id(&ntf->conn_id);
80
81 pr_debug("status 0x%x, conn_id %d\n", ntf->status, ntf->conn_id);
82
83 /* complete the data exchange transaction, if exists */
84 if (test_bit(NCI_DATA_EXCHANGE, &ndev->flags))
85 nci_data_exchange_complete(ndev, NULL, -EIO);
86}
87
71static __u8 *nci_extract_rf_params_nfca_passive_poll(struct nci_dev *ndev, 88static __u8 *nci_extract_rf_params_nfca_passive_poll(struct nci_dev *ndev,
72 struct nci_rf_intf_activated_ntf *ntf, __u8 *data) 89 struct nci_rf_intf_activated_ntf *ntf, __u8 *data)
73{ 90{
@@ -137,6 +154,12 @@ static void nci_target_found(struct nci_dev *ndev,
137 154
138 nfc_tgt.sens_res = ntf->rf_tech_specific_params.nfca_poll.sens_res; 155 nfc_tgt.sens_res = ntf->rf_tech_specific_params.nfca_poll.sens_res;
139 nfc_tgt.sel_res = ntf->rf_tech_specific_params.nfca_poll.sel_res; 156 nfc_tgt.sel_res = ntf->rf_tech_specific_params.nfca_poll.sel_res;
157 nfc_tgt.nfcid1_len = ntf->rf_tech_specific_params.nfca_poll.nfcid1_len;
158 if (nfc_tgt.nfcid1_len > 0) {
159 memcpy(nfc_tgt.nfcid1,
160 ntf->rf_tech_specific_params.nfca_poll.nfcid1,
161 nfc_tgt.nfcid1_len);
162 }
140 163
141 if (!(nfc_tgt.supported_protocols & ndev->poll_prots)) { 164 if (!(nfc_tgt.supported_protocols & ndev->poll_prots)) {
142 pr_debug("the target found does not have the desired protocol\n"); 165 pr_debug("the target found does not have the desired protocol\n");
@@ -147,6 +170,11 @@ static void nci_target_found(struct nci_dev *ndev,
147 nfc_tgt.supported_protocols); 170 nfc_tgt.supported_protocols);
148 171
149 ndev->target_available_prots = nfc_tgt.supported_protocols; 172 ndev->target_available_prots = nfc_tgt.supported_protocols;
173 ndev->max_data_pkt_payload_size = ntf->max_data_pkt_payload_size;
174 ndev->initial_num_credits = ntf->initial_num_credits;
175
176 /* set the available credits to initial value */
177 atomic_set(&ndev->credits_cnt, ndev->initial_num_credits);
150 178
151 nfc_targets_found(ndev->nfc_dev, &nfc_tgt, 1); 179 nfc_targets_found(ndev->nfc_dev, &nfc_tgt, 1);
152} 180}
@@ -162,16 +190,21 @@ static void nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev,
162 set_bit(NCI_POLL_ACTIVE, &ndev->flags); 190 set_bit(NCI_POLL_ACTIVE, &ndev->flags);
163 191
164 ntf.rf_discovery_id = *data++; 192 ntf.rf_discovery_id = *data++;
165 ntf.rf_interface_type = *data++; 193 ntf.rf_interface = *data++;
166 ntf.rf_protocol = *data++; 194 ntf.rf_protocol = *data++;
167 ntf.activation_rf_tech_and_mode = *data++; 195 ntf.activation_rf_tech_and_mode = *data++;
196 ntf.max_data_pkt_payload_size = *data++;
197 ntf.initial_num_credits = *data++;
168 ntf.rf_tech_specific_params_len = *data++; 198 ntf.rf_tech_specific_params_len = *data++;
169 199
170 pr_debug("rf_discovery_id %d\n", ntf.rf_discovery_id); 200 pr_debug("rf_discovery_id %d\n", ntf.rf_discovery_id);
171 pr_debug("rf_interface_type 0x%x\n", ntf.rf_interface_type); 201 pr_debug("rf_interface 0x%x\n", ntf.rf_interface);
172 pr_debug("rf_protocol 0x%x\n", ntf.rf_protocol); 202 pr_debug("rf_protocol 0x%x\n", ntf.rf_protocol);
173 pr_debug("activation_rf_tech_and_mode 0x%x\n", 203 pr_debug("activation_rf_tech_and_mode 0x%x\n",
174 ntf.activation_rf_tech_and_mode); 204 ntf.activation_rf_tech_and_mode);
205 pr_debug("max_data_pkt_payload_size 0x%x\n",
206 ntf.max_data_pkt_payload_size);
207 pr_debug("initial_num_credits 0x%x\n", ntf.initial_num_credits);
175 pr_debug("rf_tech_specific_params_len %d\n", 208 pr_debug("rf_tech_specific_params_len %d\n",
176 ntf.rf_tech_specific_params_len); 209 ntf.rf_tech_specific_params_len);
177 210
@@ -204,7 +237,7 @@ static void nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev,
204 ntf.activation_params_len); 237 ntf.activation_params_len);
205 238
206 if (ntf.activation_params_len > 0) { 239 if (ntf.activation_params_len > 0) {
207 switch (ntf.rf_interface_type) { 240 switch (ntf.rf_interface) {
208 case NCI_RF_INTERFACE_ISO_DEP: 241 case NCI_RF_INTERFACE_ISO_DEP:
209 err = nci_extract_activation_params_iso_dep(ndev, 242 err = nci_extract_activation_params_iso_dep(ndev,
210 &ntf, data); 243 &ntf, data);
@@ -215,8 +248,8 @@ static void nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev,
215 break; 248 break;
216 249
217 default: 250 default:
218 pr_err("unsupported rf_interface_type 0x%x\n", 251 pr_err("unsupported rf_interface 0x%x\n",
219 ntf.rf_interface_type); 252 ntf.rf_interface);
220 return; 253 return;
221 } 254 }
222 } 255 }
@@ -244,9 +277,6 @@ static void nci_rf_deactivate_ntf_packet(struct nci_dev *ndev,
244 ndev->rx_data_reassembly = 0; 277 ndev->rx_data_reassembly = 0;
245 } 278 }
246 279
247 /* set the available credits to initial value */
248 atomic_set(&ndev->credits_cnt, ndev->initial_num_credits);
249
250 /* complete the data exchange transaction, if exists */ 280 /* complete the data exchange transaction, if exists */
251 if (test_bit(NCI_DATA_EXCHANGE, &ndev->flags)) 281 if (test_bit(NCI_DATA_EXCHANGE, &ndev->flags))
252 nci_data_exchange_complete(ndev, NULL, -EIO); 282 nci_data_exchange_complete(ndev, NULL, -EIO);
@@ -270,6 +300,10 @@ void nci_ntf_packet(struct nci_dev *ndev, struct sk_buff *skb)
270 nci_core_conn_credits_ntf_packet(ndev, skb); 300 nci_core_conn_credits_ntf_packet(ndev, skb);
271 break; 301 break;
272 302
303 case NCI_OP_CORE_INTF_ERROR_NTF:
304 nci_core_conn_intf_error_ntf_packet(ndev, skb);
305 break;
306
273 case NCI_OP_RF_INTF_ACTIVATED_NTF: 307 case NCI_OP_RF_INTF_ACTIVATED_NTF:
274 nci_rf_intf_activated_ntf_packet(ndev, skb); 308 nci_rf_intf_activated_ntf_packet(ndev, skb);
275 break; 309 break;
diff --git a/net/nfc/nci/rsp.c b/net/nfc/nci/rsp.c
index 3f444c8a66e9..2840ae2f3615 100644
--- a/net/nfc/nci/rsp.c
+++ b/net/nfc/nci/rsp.c
@@ -86,17 +86,11 @@ static void nci_core_init_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb)
86 rsp_2->max_ctrl_pkt_payload_len; 86 rsp_2->max_ctrl_pkt_payload_len;
87 ndev->max_size_for_large_params = 87 ndev->max_size_for_large_params =
88 __le16_to_cpu(rsp_2->max_size_for_large_params); 88 __le16_to_cpu(rsp_2->max_size_for_large_params);
89 ndev->max_data_pkt_payload_size =
90 rsp_2->max_data_pkt_payload_size;
91 ndev->initial_num_credits =
92 rsp_2->initial_num_credits;
93 ndev->manufact_id = 89 ndev->manufact_id =
94 rsp_2->manufact_id; 90 rsp_2->manufact_id;
95 ndev->manufact_specific_info = 91 ndev->manufact_specific_info =
96 __le32_to_cpu(rsp_2->manufact_specific_info); 92 __le32_to_cpu(rsp_2->manufact_specific_info);
97 93
98 atomic_set(&ndev->credits_cnt, ndev->initial_num_credits);
99
100 pr_debug("nfcc_features 0x%x\n", 94 pr_debug("nfcc_features 0x%x\n",
101 ndev->nfcc_features); 95 ndev->nfcc_features);
102 pr_debug("num_supported_rf_interfaces %d\n", 96 pr_debug("num_supported_rf_interfaces %d\n",
@@ -117,10 +111,6 @@ static void nci_core_init_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb)
117 ndev->max_ctrl_pkt_payload_len); 111 ndev->max_ctrl_pkt_payload_len);
118 pr_debug("max_size_for_large_params %d\n", 112 pr_debug("max_size_for_large_params %d\n",
119 ndev->max_size_for_large_params); 113 ndev->max_size_for_large_params);
120 pr_debug("max_data_pkt_payload_size %d\n",
121 ndev->max_data_pkt_payload_size);
122 pr_debug("initial_num_credits %d\n",
123 ndev->initial_num_credits);
124 pr_debug("manufact_id 0x%x\n", 114 pr_debug("manufact_id 0x%x\n",
125 ndev->manufact_id); 115 ndev->manufact_id);
126 pr_debug("manufact_specific_info 0x%x\n", 116 pr_debug("manufact_specific_info 0x%x\n",
diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c
index 43a1c47756a7..6989dfa28ee2 100644
--- a/net/nfc/netlink.c
+++ b/net/nfc/netlink.c
@@ -67,6 +67,9 @@ static int nfc_genl_send_target(struct sk_buff *msg, struct nfc_target *target,
67 target->supported_protocols); 67 target->supported_protocols);
68 NLA_PUT_U16(msg, NFC_ATTR_TARGET_SENS_RES, target->sens_res); 68 NLA_PUT_U16(msg, NFC_ATTR_TARGET_SENS_RES, target->sens_res);
69 NLA_PUT_U8(msg, NFC_ATTR_TARGET_SEL_RES, target->sel_res); 69 NLA_PUT_U8(msg, NFC_ATTR_TARGET_SEL_RES, target->sel_res);
70 if (target->nfcid1_len > 0)
71 NLA_PUT(msg, NFC_ATTR_TARGET_NFCID1, target->nfcid1_len,
72 target->nfcid1);
70 73
71 return genlmsg_end(msg, hdr); 74 return genlmsg_end(msg, hdr);
72 75
diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c
index ca355e7e58b4..865adb61685a 100644
--- a/net/rfkill/rfkill-gpio.c
+++ b/net/rfkill/rfkill-gpio.c
@@ -105,7 +105,7 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
105 ret = pdata->gpio_runtime_setup(pdev); 105 ret = pdata->gpio_runtime_setup(pdev);
106 if (ret) { 106 if (ret) {
107 pr_warn("%s: can't set up gpio\n", __func__); 107 pr_warn("%s: can't set up gpio\n", __func__);
108 return ret; 108 goto fail_alloc;
109 } 109 }
110 } 110 }
111 111
diff --git a/net/wireless/genregdb.awk b/net/wireless/genregdb.awk
index 53c143f5e770..9392f8cbb901 100644
--- a/net/wireless/genregdb.awk
+++ b/net/wireless/genregdb.awk
@@ -7,10 +7,17 @@
7# 7#
8# Copyright 2009 John W. Linville <linville@tuxdriver.com> 8# Copyright 2009 John W. Linville <linville@tuxdriver.com>
9# 9#
10# This program is free software; you can redistribute it and/or modify 10# Permission to use, copy, modify, and/or distribute this software for any
11# it under the terms of the GNU General Public License version 2 as 11# purpose with or without fee is hereby granted, provided that the above
12# published by the Free Software Foundation. 12# copyright notice and this permission notice appear in all copies.
13# 13#
14# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
15# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
16# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
17# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
19# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
20# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14 21
15BEGIN { 22BEGIN {
16 active = 0 23 active = 0
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index c45c8b772ddd..f65feaad155f 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2,13 +2,22 @@
2 * Copyright 2002-2005, Instant802 Networks, Inc. 2 * Copyright 2002-2005, Instant802 Networks, Inc.
3 * Copyright 2005-2006, Devicescape Software, Inc. 3 * Copyright 2005-2006, Devicescape Software, Inc.
4 * Copyright 2007 Johannes Berg <johannes@sipsolutions.net> 4 * Copyright 2007 Johannes Berg <johannes@sipsolutions.net>
5 * Copyright 2008 Luis R. Rodriguez <lrodriguz@atheros.com> 5 * Copyright 2008-2011 Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * Permission to use, copy, modify, and/or distribute this software for any
8 * it under the terms of the GNU General Public License version 2 as 8 * purpose with or without fee is hereby granted, provided that the above
9 * published by the Free Software Foundation. 9 * copyright notice and this permission notice appear in all copies.
10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
10 */ 18 */
11 19
20
12/** 21/**
13 * DOC: Wireless regulatory infrastructure 22 * DOC: Wireless regulatory infrastructure
14 * 23 *
@@ -1480,18 +1489,18 @@ new_request:
1480} 1489}
1481 1490
1482/* This processes *all* regulatory hints */ 1491/* This processes *all* regulatory hints */
1483static void reg_process_hint(struct regulatory_request *reg_request) 1492static void reg_process_hint(struct regulatory_request *reg_request,
1493 enum nl80211_reg_initiator reg_initiator)
1484{ 1494{
1485 int r = 0; 1495 int r = 0;
1486 struct wiphy *wiphy = NULL; 1496 struct wiphy *wiphy = NULL;
1487 enum nl80211_reg_initiator initiator = reg_request->initiator;
1488 1497
1489 BUG_ON(!reg_request->alpha2); 1498 BUG_ON(!reg_request->alpha2);
1490 1499
1491 if (wiphy_idx_valid(reg_request->wiphy_idx)) 1500 if (wiphy_idx_valid(reg_request->wiphy_idx))
1492 wiphy = wiphy_idx_to_wiphy(reg_request->wiphy_idx); 1501 wiphy = wiphy_idx_to_wiphy(reg_request->wiphy_idx);
1493 1502
1494 if (reg_request->initiator == NL80211_REGDOM_SET_BY_DRIVER && 1503 if (reg_initiator == NL80211_REGDOM_SET_BY_DRIVER &&
1495 !wiphy) { 1504 !wiphy) {
1496 kfree(reg_request); 1505 kfree(reg_request);
1497 return; 1506 return;
@@ -1501,7 +1510,7 @@ static void reg_process_hint(struct regulatory_request *reg_request)
1501 /* This is required so that the orig_* parameters are saved */ 1510 /* This is required so that the orig_* parameters are saved */
1502 if (r == -EALREADY && wiphy && 1511 if (r == -EALREADY && wiphy &&
1503 wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY) { 1512 wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY) {
1504 wiphy_update_regulatory(wiphy, initiator); 1513 wiphy_update_regulatory(wiphy, reg_initiator);
1505 return; 1514 return;
1506 } 1515 }
1507 1516
@@ -1510,7 +1519,7 @@ static void reg_process_hint(struct regulatory_request *reg_request)
1510 * source of bogus requests. 1519 * source of bogus requests.
1511 */ 1520 */
1512 if (r != -EALREADY && 1521 if (r != -EALREADY &&
1513 reg_request->initiator == NL80211_REGDOM_SET_BY_USER) 1522 reg_initiator == NL80211_REGDOM_SET_BY_USER)
1514 schedule_delayed_work(&reg_timeout, msecs_to_jiffies(3142)); 1523 schedule_delayed_work(&reg_timeout, msecs_to_jiffies(3142));
1515} 1524}
1516 1525
@@ -1547,7 +1556,7 @@ static void reg_process_pending_hints(void)
1547 1556
1548 spin_unlock(&reg_requests_lock); 1557 spin_unlock(&reg_requests_lock);
1549 1558
1550 reg_process_hint(reg_request); 1559 reg_process_hint(reg_request, reg_request->initiator);
1551 1560
1552out: 1561out:
1553 mutex_unlock(&reg_mutex); 1562 mutex_unlock(&reg_mutex);
@@ -1830,6 +1839,7 @@ static void restore_custom_reg_settings(struct wiphy *wiphy)
1830static void restore_regulatory_settings(bool reset_user) 1839static void restore_regulatory_settings(bool reset_user)
1831{ 1840{
1832 char alpha2[2]; 1841 char alpha2[2];
1842 char world_alpha2[2];
1833 struct reg_beacon *reg_beacon, *btmp; 1843 struct reg_beacon *reg_beacon, *btmp;
1834 struct regulatory_request *reg_request, *tmp; 1844 struct regulatory_request *reg_request, *tmp;
1835 LIST_HEAD(tmp_reg_req_list); 1845 LIST_HEAD(tmp_reg_req_list);
@@ -1881,6 +1891,8 @@ static void restore_regulatory_settings(bool reset_user)
1881 1891
1882 /* First restore to the basic regulatory settings */ 1892 /* First restore to the basic regulatory settings */
1883 cfg80211_regdomain = cfg80211_world_regdom; 1893 cfg80211_regdomain = cfg80211_world_regdom;
1894 world_alpha2[0] = cfg80211_regdomain->alpha2[0];
1895 world_alpha2[1] = cfg80211_regdomain->alpha2[1];
1884 1896
1885 list_for_each_entry(rdev, &cfg80211_rdev_list, list) { 1897 list_for_each_entry(rdev, &cfg80211_rdev_list, list) {
1886 if (rdev->wiphy.flags & WIPHY_FLAG_CUSTOM_REGULATORY) 1898 if (rdev->wiphy.flags & WIPHY_FLAG_CUSTOM_REGULATORY)
@@ -1890,7 +1902,7 @@ static void restore_regulatory_settings(bool reset_user)
1890 mutex_unlock(&reg_mutex); 1902 mutex_unlock(&reg_mutex);
1891 mutex_unlock(&cfg80211_mutex); 1903 mutex_unlock(&cfg80211_mutex);
1892 1904
1893 regulatory_hint_core(cfg80211_regdomain->alpha2); 1905 regulatory_hint_core(world_alpha2);
1894 1906
1895 /* 1907 /*
1896 * This restores the ieee80211_regdom module parameter 1908 * This restores the ieee80211_regdom module parameter
@@ -1987,7 +1999,7 @@ static void print_rd_rules(const struct ieee80211_regdomain *rd)
1987 const struct ieee80211_freq_range *freq_range = NULL; 1999 const struct ieee80211_freq_range *freq_range = NULL;
1988 const struct ieee80211_power_rule *power_rule = NULL; 2000 const struct ieee80211_power_rule *power_rule = NULL;
1989 2001
1990 pr_info(" (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)\n"); 2002 pr_info(" (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)\n");
1991 2003
1992 for (i = 0; i < rd->n_reg_rules; i++) { 2004 for (i = 0; i < rd->n_reg_rules; i++) {
1993 reg_rule = &rd->reg_rules[i]; 2005 reg_rule = &rd->reg_rules[i];
@@ -1999,14 +2011,14 @@ static void print_rd_rules(const struct ieee80211_regdomain *rd)
1999 * in certain regions 2011 * in certain regions
2000 */ 2012 */
2001 if (power_rule->max_antenna_gain) 2013 if (power_rule->max_antenna_gain)
2002 pr_info(" (%d KHz - %d KHz @ %d KHz), (%d mBi, %d mBm)\n", 2014 pr_info(" (%d KHz - %d KHz @ %d KHz), (%d mBi, %d mBm)\n",
2003 freq_range->start_freq_khz, 2015 freq_range->start_freq_khz,
2004 freq_range->end_freq_khz, 2016 freq_range->end_freq_khz,
2005 freq_range->max_bandwidth_khz, 2017 freq_range->max_bandwidth_khz,
2006 power_rule->max_antenna_gain, 2018 power_rule->max_antenna_gain,
2007 power_rule->max_eirp); 2019 power_rule->max_eirp);
2008 else 2020 else
2009 pr_info(" (%d KHz - %d KHz @ %d KHz), (N/A, %d mBm)\n", 2021 pr_info(" (%d KHz - %d KHz @ %d KHz), (N/A, %d mBm)\n",
2010 freq_range->start_freq_khz, 2022 freq_range->start_freq_khz,
2011 freq_range->end_freq_khz, 2023 freq_range->end_freq_khz,
2012 freq_range->max_bandwidth_khz, 2024 freq_range->max_bandwidth_khz,
diff --git a/net/wireless/reg.h b/net/wireless/reg.h
index 786e414afd91..e2aaaf525a22 100644
--- a/net/wireless/reg.h
+++ b/net/wireless/reg.h
@@ -1,5 +1,20 @@
1#ifndef __NET_WIRELESS_REG_H 1#ifndef __NET_WIRELESS_REG_H
2#define __NET_WIRELESS_REG_H 2#define __NET_WIRELESS_REG_H
3/*
4 * Copyright 2008-2011 Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
5 *
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
3 18
4extern const struct ieee80211_regdomain *cfg80211_regdomain; 19extern const struct ieee80211_regdomain *cfg80211_regdomain;
5 20
diff --git a/net/wireless/regdb.h b/net/wireless/regdb.h
index 818222c92513..3279cfcefb0c 100644
--- a/net/wireless/regdb.h
+++ b/net/wireless/regdb.h
@@ -1,6 +1,22 @@
1#ifndef __REGDB_H__ 1#ifndef __REGDB_H__
2#define __REGDB_H__ 2#define __REGDB_H__
3 3
4/*
5 * Copyright 2009 John W. Linville <linville@tuxdriver.com>
6 *
7 * Permission to use, copy, modify, and/or distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */
19
4extern const struct ieee80211_regdomain *reg_regdb[]; 20extern const struct ieee80211_regdomain *reg_regdb[];
5extern int reg_regdb_size; 21extern int reg_regdb_size;
6 22
diff --git a/net/wireless/util.c b/net/wireless/util.c
index e77df7585004..9aa9db6c8141 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -9,6 +9,7 @@
9#include <linux/slab.h> 9#include <linux/slab.h>
10#include <net/cfg80211.h> 10#include <net/cfg80211.h>
11#include <net/ip.h> 11#include <net/ip.h>
12#include <net/dsfield.h>
12#include "core.h" 13#include "core.h"
13 14
14struct ieee80211_rate * 15struct ieee80211_rate *
@@ -650,7 +651,10 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb)
650 651
651 switch (skb->protocol) { 652 switch (skb->protocol) {
652 case htons(ETH_P_IP): 653 case htons(ETH_P_IP):
653 dscp = ip_hdr(skb)->tos & 0xfc; 654 dscp = ipv4_get_dsfield(ip_hdr(skb)) & 0xfc;
655 break;
656 case htons(ETH_P_IPV6):
657 dscp = ipv6_get_dsfield(ipv6_hdr(skb)) & 0xfc;
654 break; 658 break;
655 default: 659 default:
656 return 0; 660 return 0;