aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2007-06-12 22:27:52 -0400
committerJeff Garzik <jeff@garzik.org>2007-06-12 22:27:52 -0400
commitbca1a5518cab2d58c766863c61ee4ef5f1cc4caa (patch)
tree0f7922ed840c7d778ceb63b63d40d282ccfa0fcc
parent12b90de64f38226e1e095c55b533f0f4d4f0f572 (diff)
parent82fde74b94f11eee1e9c30e43fb162f80a5e63c0 (diff)
Merge branch 'libertas-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 into upstream-fixes
-rw-r--r--drivers/net/wireless/libertas/assoc.c13
-rw-r--r--drivers/net/wireless/libertas/assoc.h2
-rw-r--r--drivers/net/wireless/libertas/cmdresp.c1
-rw-r--r--drivers/net/wireless/libertas/dev.h1
-rw-r--r--drivers/net/wireless/libertas/host.h4
-rw-r--r--drivers/net/wireless/libertas/main.c27
-rw-r--r--drivers/net/wireless/libertas/rx.c5
7 files changed, 35 insertions, 18 deletions
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index ee82413b426d..f67efa0815fe 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -200,6 +200,14 @@ static int update_channel(wlan_private * priv)
200 cmd_option_waitforrsp, 0, NULL); 200 cmd_option_waitforrsp, 0, NULL);
201} 201}
202 202
203void libertas_sync_channel(struct work_struct *work)
204{
205 wlan_private *priv = container_of(work, wlan_private, sync_channel);
206
207 if (update_channel(priv) != 0)
208 lbs_pr_info("Channel synchronization failed.");
209}
210
203static int assoc_helper_channel(wlan_private *priv, 211static int assoc_helper_channel(wlan_private *priv,
204 struct assoc_request * assoc_req) 212 struct assoc_request * assoc_req)
205{ 213{
@@ -403,6 +411,11 @@ static int should_deauth_infrastructure(wlan_adapter *adapter,
403 return 1; 411 return 1;
404 } 412 }
405 413
414 if (test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) {
415 lbs_deb_assoc("Deauthenticating due to channel switch.\n");
416 return 1;
417 }
418
406 /* FIXME: deal with 'auto' mode somehow */ 419 /* FIXME: deal with 'auto' mode somehow */
407 if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) { 420 if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) {
408 if (assoc_req->mode != IW_MODE_INFRA) 421 if (assoc_req->mode != IW_MODE_INFRA)
diff --git a/drivers/net/wireless/libertas/assoc.h b/drivers/net/wireless/libertas/assoc.h
index b5eddf8d3b39..5e9c31f0932b 100644
--- a/drivers/net/wireless/libertas/assoc.h
+++ b/drivers/net/wireless/libertas/assoc.h
@@ -9,6 +9,8 @@ void libertas_association_worker(struct work_struct *work);
9 9
10struct assoc_request * wlan_get_association_request(wlan_adapter *adapter); 10struct assoc_request * wlan_get_association_request(wlan_adapter *adapter);
11 11
12void libertas_sync_channel(struct work_struct *work);
13
12#define ASSOC_DELAY (HZ / 2) 14#define ASSOC_DELAY (HZ / 2)
13static inline void wlan_postpone_association_work(wlan_private *priv) 15static inline void wlan_postpone_association_work(wlan_private *priv)
14{ 16{
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index ebedd630d72e..0c3b9a583d83 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -987,6 +987,7 @@ int libertas_process_event(wlan_private * priv)
987 netif_carrier_on(priv->mesh_dev) ; 987 netif_carrier_on(priv->mesh_dev) ;
988 } 988 }
989 adapter->mode = IW_MODE_ADHOC ; 989 adapter->mode = IW_MODE_ADHOC ;
990 schedule_work(&priv->sync_channel);
990 break; 991 break;
991 992
992 default: 993 default:
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h
index d6c340aef681..785192b884bc 100644
--- a/drivers/net/wireless/libertas/dev.h
+++ b/drivers/net/wireless/libertas/dev.h
@@ -150,6 +150,7 @@ struct _wlan_private {
150 150
151 struct delayed_work assoc_work; 151 struct delayed_work assoc_work;
152 struct workqueue_struct *assoc_thread; 152 struct workqueue_struct *assoc_thread;
153 struct work_struct sync_channel;
153 154
154 /** Hardware access */ 155 /** Hardware access */
155 int (*hw_register_dev) (wlan_private * priv); 156 int (*hw_register_dev) (wlan_private * priv);
diff --git a/drivers/net/wireless/libertas/host.h b/drivers/net/wireless/libertas/host.h
index cedf1dbab050..7509cc10af3c 100644
--- a/drivers/net/wireless/libertas/host.h
+++ b/drivers/net/wireless/libertas/host.h
@@ -310,8 +310,8 @@ enum cmd_mesh_access_opts {
310 cmd_act_mesh_get_ttl = 1, 310 cmd_act_mesh_get_ttl = 1,
311 cmd_act_mesh_set_ttl, 311 cmd_act_mesh_set_ttl,
312 cmd_act_mesh_get_stats, 312 cmd_act_mesh_get_stats,
313 cmd_act_mesh_get_mpp, 313 cmd_act_mesh_get_anycast,
314 cmd_act_mesh_set_mpp, 314 cmd_act_mesh_set_anycast,
315}; 315};
316 316
317/** Card Event definition */ 317/** Card Event definition */
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index ec9be0c51c69..623ab4b16973 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -178,45 +178,45 @@ u16 libertas_region_code_to_index[MRVDRV_MAX_REGION_CODE] =
178 */ 178 */
179 179
180/** 180/**
181 * @brief Get function for sysfs attribute libertas_mpp 181 * @brief Get function for sysfs attribute anycast_mask
182 */ 182 */
183static ssize_t libertas_mpp_get(struct device * dev, 183static ssize_t libertas_anycast_get(struct device * dev,
184 struct device_attribute *attr, char * buf) { 184 struct device_attribute *attr, char * buf) {
185 struct cmd_ds_mesh_access mesh_access; 185 struct cmd_ds_mesh_access mesh_access;
186 186
187 memset(&mesh_access, 0, sizeof(mesh_access)); 187 memset(&mesh_access, 0, sizeof(mesh_access));
188 libertas_prepare_and_send_command(to_net_dev(dev)->priv, 188 libertas_prepare_and_send_command(to_net_dev(dev)->priv,
189 cmd_mesh_access, 189 cmd_mesh_access,
190 cmd_act_mesh_get_mpp, 190 cmd_act_mesh_get_anycast,
191 cmd_option_waitforrsp, 0, (void *)&mesh_access); 191 cmd_option_waitforrsp, 0, (void *)&mesh_access);
192 192
193 return snprintf(buf, 3, "%d\n", le32_to_cpu(mesh_access.data[0])); 193 return snprintf(buf, 12, "0x%X\n", le32_to_cpu(mesh_access.data[0]));
194} 194}
195 195
196/** 196/**
197 * @brief Set function for sysfs attribute libertas_mpp 197 * @brief Set function for sysfs attribute anycast_mask
198 */ 198 */
199static ssize_t libertas_mpp_set(struct device * dev, 199static ssize_t libertas_anycast_set(struct device * dev,
200 struct device_attribute *attr, const char * buf, size_t count) { 200 struct device_attribute *attr, const char * buf, size_t count) {
201 struct cmd_ds_mesh_access mesh_access; 201 struct cmd_ds_mesh_access mesh_access;
202 uint32_t datum; 202 uint32_t datum;
203 203
204 memset(&mesh_access, 0, sizeof(mesh_access)); 204 memset(&mesh_access, 0, sizeof(mesh_access));
205 sscanf(buf, "%d", &datum); 205 sscanf(buf, "%x", &datum);
206 mesh_access.data[0] = cpu_to_le32(datum); 206 mesh_access.data[0] = cpu_to_le32(datum);
207 207
208 libertas_prepare_and_send_command((to_net_dev(dev))->priv, 208 libertas_prepare_and_send_command((to_net_dev(dev))->priv,
209 cmd_mesh_access, 209 cmd_mesh_access,
210 cmd_act_mesh_set_mpp, 210 cmd_act_mesh_set_anycast,
211 cmd_option_waitforrsp, 0, (void *)&mesh_access); 211 cmd_option_waitforrsp, 0, (void *)&mesh_access);
212 return strlen(buf); 212 return strlen(buf);
213} 213}
214 214
215/** 215/**
216 * libertas_mpp attribute to be exported per mshX interface 216 * anycast_mask attribute to be exported per mshX interface
217 * through sysfs (/sys/class/net/mshX/libertas-mpp) 217 * through sysfs (/sys/class/net/mshX/anycast_mask)
218 */ 218 */
219static DEVICE_ATTR(libertas_mpp, 0644, libertas_mpp_get, libertas_mpp_set ); 219static DEVICE_ATTR(anycast_mask, 0644, libertas_anycast_get, libertas_anycast_set);
220 220
221/** 221/**
222 * @brief Check if the device can be open and wait if necessary. 222 * @brief Check if the device can be open and wait if necessary.
@@ -847,6 +847,7 @@ int libertas_activate_card(wlan_private *priv, char *fw_name)
847 priv->assoc_thread = 847 priv->assoc_thread =
848 create_singlethread_workqueue("libertas_assoc"); 848 create_singlethread_workqueue("libertas_assoc");
849 INIT_DELAYED_WORK(&priv->assoc_work, libertas_association_worker); 849 INIT_DELAYED_WORK(&priv->assoc_work, libertas_association_worker);
850 INIT_WORK(&priv->sync_channel, libertas_sync_channel);
850 851
851 /* 852 /*
852 * Register the device. Fillup the private data structure with 853 * Register the device. Fillup the private data structure with
@@ -938,7 +939,7 @@ int libertas_add_mesh(wlan_private *priv, struct device *dev)
938 goto err_free; 939 goto err_free;
939 } 940 }
940 941
941 ret = device_create_file(&(mesh_dev->dev), &dev_attr_libertas_mpp); 942 ret = device_create_file(&(mesh_dev->dev), &dev_attr_anycast_mask);
942 if (ret) 943 if (ret)
943 goto err_unregister; 944 goto err_unregister;
944 945
@@ -1048,7 +1049,7 @@ void libertas_remove_mesh(wlan_private *priv)
1048 netif_stop_queue(mesh_dev); 1049 netif_stop_queue(mesh_dev);
1049 netif_carrier_off(priv->mesh_dev); 1050 netif_carrier_off(priv->mesh_dev);
1050 1051
1051 device_remove_file(&(mesh_dev->dev), &dev_attr_libertas_mpp); 1052 device_remove_file(&(mesh_dev->dev), &dev_attr_anycast_mask);
1052 unregister_netdev(mesh_dev); 1053 unregister_netdev(mesh_dev);
1053 1054
1054 priv->mesh_dev = NULL ; 1055 priv->mesh_dev = NULL ;
diff --git a/drivers/net/wireless/libertas/rx.c b/drivers/net/wireless/libertas/rx.c
index 5d70a7625150..88d9d2d787d5 100644
--- a/drivers/net/wireless/libertas/rx.c
+++ b/drivers/net/wireless/libertas/rx.c
@@ -141,10 +141,9 @@ void libertas_upload_rx_packet(wlan_private * priv, struct sk_buff *skb)
141 lbs_deb_rx("skb->data %p\n", skb->data); 141 lbs_deb_rx("skb->data %p\n", skb->data);
142 142
143 if (priv->mesh_dev && IS_MESH_FRAME(skb)) 143 if (priv->mesh_dev && IS_MESH_FRAME(skb))
144 skb->dev = priv->mesh_dev; 144 skb->protocol = eth_type_trans(skb, priv->mesh_dev);
145 else 145 else
146 skb->dev = priv->dev; 146 skb->protocol = eth_type_trans(skb, priv->dev);
147 skb->protocol = eth_type_trans(skb, priv->dev);
148 skb->ip_summed = CHECKSUM_UNNECESSARY; 147 skb->ip_summed = CHECKSUM_UNNECESSARY;
149 148
150 netif_rx(skb); 149 netif_rx(skb);