diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/net/wireless/airo.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'drivers/net/wireless/airo.c')
-rw-r--r-- | drivers/net/wireless/airo.c | 142 |
1 files changed, 61 insertions, 81 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index 1d05445d4ba3..55cf71fbffe3 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -105,7 +105,7 @@ static struct pci_driver airo_driver = { | |||
105 | of statistics in the /proc filesystem */ | 105 | of statistics in the /proc filesystem */ |
106 | 106 | ||
107 | #define IGNLABEL(comment) NULL | 107 | #define IGNLABEL(comment) NULL |
108 | static char *statsLabels[] = { | 108 | static const char *statsLabels[] = { |
109 | "RxOverrun", | 109 | "RxOverrun", |
110 | IGNLABEL("RxPlcpCrcErr"), | 110 | IGNLABEL("RxPlcpCrcErr"), |
111 | IGNLABEL("RxPlcpFormatErr"), | 111 | IGNLABEL("RxPlcpFormatErr"), |
@@ -217,7 +217,6 @@ static char *statsLabels[] = { | |||
217 | (no spaces) list of rates (up to 8). */ | 217 | (no spaces) list of rates (up to 8). */ |
218 | 218 | ||
219 | static int rates[8]; | 219 | static int rates[8]; |
220 | static int basic_rate; | ||
221 | static char *ssids[3]; | 220 | static char *ssids[3]; |
222 | 221 | ||
223 | static int io[4]; | 222 | static int io[4]; |
@@ -243,29 +242,29 @@ static int airo_perm = 0555; | |||
243 | static int proc_perm = 0644; | 242 | static int proc_perm = 0644; |
244 | 243 | ||
245 | MODULE_AUTHOR("Benjamin Reed"); | 244 | MODULE_AUTHOR("Benjamin Reed"); |
246 | MODULE_DESCRIPTION("Support for Cisco/Aironet 802.11 wireless ethernet \ | 245 | MODULE_DESCRIPTION("Support for Cisco/Aironet 802.11 wireless ethernet cards. " |
247 | cards. Direct support for ISA/PCI/MPI cards and support \ | 246 | "Direct support for ISA/PCI/MPI cards and support for PCMCIA when used with airo_cs."); |
248 | for PCMCIA when used with airo_cs."); | ||
249 | MODULE_LICENSE("Dual BSD/GPL"); | 247 | MODULE_LICENSE("Dual BSD/GPL"); |
250 | MODULE_SUPPORTED_DEVICE("Aironet 4500, 4800 and Cisco 340/350"); | 248 | MODULE_SUPPORTED_DEVICE("Aironet 4500, 4800 and Cisco 340/350"); |
251 | module_param_array(io, int, NULL, 0); | 249 | module_param_array(io, int, NULL, 0); |
252 | module_param_array(irq, int, NULL, 0); | 250 | module_param_array(irq, int, NULL, 0); |
253 | module_param(basic_rate, int, 0); | ||
254 | module_param_array(rates, int, NULL, 0); | 251 | module_param_array(rates, int, NULL, 0); |
255 | module_param_array(ssids, charp, NULL, 0); | 252 | module_param_array(ssids, charp, NULL, 0); |
256 | module_param(auto_wep, int, 0); | 253 | module_param(auto_wep, int, 0); |
257 | MODULE_PARM_DESC(auto_wep, "If non-zero, the driver will keep looping through \ | 254 | MODULE_PARM_DESC(auto_wep, |
258 | the authentication options until an association is made. The value of \ | 255 | "If non-zero, the driver will keep looping through the authentication options until an association is made. " |
259 | auto_wep is number of the wep keys to check. A value of 2 will try using \ | 256 | "The value of auto_wep is number of the wep keys to check. " |
260 | the key at index 0 and index 1."); | 257 | "A value of 2 will try using the key at index 0 and index 1."); |
261 | module_param(aux_bap, int, 0); | 258 | module_param(aux_bap, int, 0); |
262 | MODULE_PARM_DESC(aux_bap, "If non-zero, the driver will switch into a mode \ | 259 | MODULE_PARM_DESC(aux_bap, |
263 | than seems to work better for older cards with some older buses. Before \ | 260 | "If non-zero, the driver will switch into a mode that seems to work better for older cards with some older buses. " |
264 | switching it checks that the switch is needed."); | 261 | "Before switching it checks that the switch is needed."); |
265 | module_param(maxencrypt, int, 0); | 262 | module_param(maxencrypt, int, 0); |
266 | MODULE_PARM_DESC(maxencrypt, "The maximum speed that the card can do \ | 263 | MODULE_PARM_DESC(maxencrypt, |
267 | encryption. Units are in 512kbs. Zero (default) means there is no limit. \ | 264 | "The maximum speed that the card can do encryption. " |
268 | Older cards used to be limited to 2mbs (4)."); | 265 | "Units are in 512kbs. " |
266 | "Zero (default) means there is no limit. " | ||
267 | "Older cards used to be limited to 2mbs (4)."); | ||
269 | module_param(adhoc, int, 0); | 268 | module_param(adhoc, int, 0); |
270 | MODULE_PARM_DESC(adhoc, "If non-zero, the card will start in adhoc mode."); | 269 | MODULE_PARM_DESC(adhoc, "If non-zero, the card will start in adhoc mode."); |
271 | module_param(probe, int, 0); | 270 | module_param(probe, int, 0); |
@@ -932,7 +931,7 @@ typedef struct aironet_ioctl { | |||
932 | unsigned char __user *data; // d-data | 931 | unsigned char __user *data; // d-data |
933 | } aironet_ioctl; | 932 | } aironet_ioctl; |
934 | 933 | ||
935 | static char swversion[] = "2.1"; | 934 | static const char swversion[] = "2.1"; |
936 | #endif /* CISCO_EXT */ | 935 | #endif /* CISCO_EXT */ |
937 | 936 | ||
938 | #define NUM_MODULES 2 | 937 | #define NUM_MODULES 2 |
@@ -1374,7 +1373,7 @@ static int micsetup(struct airo_info *ai) { | |||
1374 | return SUCCESS; | 1373 | return SUCCESS; |
1375 | } | 1374 | } |
1376 | 1375 | ||
1377 | static char micsnap[] = {0xAA,0xAA,0x03,0x00,0x40,0x96,0x00,0x02}; | 1376 | static const u8 micsnap[] = {0xAA,0xAA,0x03,0x00,0x40,0x96,0x00,0x02}; |
1378 | 1377 | ||
1379 | /*=========================================================================== | 1378 | /*=========================================================================== |
1380 | * Description: Mic a packet | 1379 | * Description: Mic a packet |
@@ -1886,7 +1885,7 @@ static int airo_open(struct net_device *dev) { | |||
1886 | /* Make sure the card is configured. | 1885 | /* Make sure the card is configured. |
1887 | * Wireless Extensions may postpone config changes until the card | 1886 | * Wireless Extensions may postpone config changes until the card |
1888 | * is open (to pipeline changes and speed-up card setup). If | 1887 | * is open (to pipeline changes and speed-up card setup). If |
1889 | * those changes are not yet commited, do it now - Jean II */ | 1888 | * those changes are not yet committed, do it now - Jean II */ |
1890 | if (test_bit(FLAG_COMMIT, &ai->flags)) { | 1889 | if (test_bit(FLAG_COMMIT, &ai->flags)) { |
1891 | disable_MAC(ai, 1); | 1890 | disable_MAC(ai, 1); |
1892 | writeConfigRid(ai, 1); | 1891 | writeConfigRid(ai, 1); |
@@ -1994,7 +1993,7 @@ static int mpi_send_packet (struct net_device *dev) | |||
1994 | /* | 1993 | /* |
1995 | * Magic, the cards firmware needs a length count (2 bytes) in the host buffer | 1994 | * Magic, the cards firmware needs a length count (2 bytes) in the host buffer |
1996 | * right after TXFID_HDR.The TXFID_HDR contains the status short so payloadlen | 1995 | * right after TXFID_HDR.The TXFID_HDR contains the status short so payloadlen |
1997 | * is immediatly after it. ------------------------------------------------ | 1996 | * is immediately after it. ------------------------------------------------ |
1998 | * |TXFIDHDR+STATUS|PAYLOADLEN|802.3HDR|PACKETDATA| | 1997 | * |TXFIDHDR+STATUS|PAYLOADLEN|802.3HDR|PACKETDATA| |
1999 | * ------------------------------------------------ | 1998 | * ------------------------------------------------ |
2000 | */ | 1999 | */ |
@@ -2008,7 +2007,7 @@ static int mpi_send_packet (struct net_device *dev) | |||
2008 | sizeof(wifictlhdr8023) + 2 ; | 2007 | sizeof(wifictlhdr8023) + 2 ; |
2009 | 2008 | ||
2010 | /* | 2009 | /* |
2011 | * Firmware automaticly puts 802 header on so | 2010 | * Firmware automatically puts 802 header on so |
2012 | * we don't need to account for it in the length | 2011 | * we don't need to account for it in the length |
2013 | */ | 2012 | */ |
2014 | if (test_bit(FLAG_MIC_CAPABLE, &ai->flags) && ai->micstats.enabled && | 2013 | if (test_bit(FLAG_MIC_CAPABLE, &ai->flags) && ai->micstats.enabled && |
@@ -2533,7 +2532,7 @@ static int mpi_init_descriptors (struct airo_info *ai) | |||
2533 | /* | 2532 | /* |
2534 | * We are setting up three things here: | 2533 | * We are setting up three things here: |
2535 | * 1) Map AUX memory for descriptors: Rid, TxFid, or RxFid. | 2534 | * 1) Map AUX memory for descriptors: Rid, TxFid, or RxFid. |
2536 | * 2) Map PCI memory for issueing commands. | 2535 | * 2) Map PCI memory for issuing commands. |
2537 | * 3) Allocate memory (shared) to send and receive ethernet frames. | 2536 | * 3) Allocate memory (shared) to send and receive ethernet frames. |
2538 | */ | 2537 | */ |
2539 | static int mpi_map_card(struct airo_info *ai, struct pci_dev *pci) | 2538 | static int mpi_map_card(struct airo_info *ai, struct pci_dev *pci) |
@@ -2723,9 +2722,8 @@ static int airo_networks_allocate(struct airo_info *ai) | |||
2723 | if (ai->networks) | 2722 | if (ai->networks) |
2724 | return 0; | 2723 | return 0; |
2725 | 2724 | ||
2726 | ai->networks = | 2725 | ai->networks = kcalloc(AIRO_MAX_NETWORK_COUNT, sizeof(BSSListElement), |
2727 | kzalloc(AIRO_MAX_NETWORK_COUNT * sizeof(BSSListElement), | 2726 | GFP_KERNEL); |
2728 | GFP_KERNEL); | ||
2729 | if (!ai->networks) { | 2727 | if (!ai->networks) { |
2730 | airo_print_warn("", "Out of memory allocating beacons"); | 2728 | airo_print_warn("", "Out of memory allocating beacons"); |
2731 | return -ENOMEM; | 2729 | return -ENOMEM; |
@@ -3884,15 +3882,6 @@ static u16 setup_card(struct airo_info *ai, u8 *mac, int lock) | |||
3884 | ai->config.rates[i] = rates[i]; | 3882 | ai->config.rates[i] = rates[i]; |
3885 | } | 3883 | } |
3886 | } | 3884 | } |
3887 | if ( basic_rate > 0 ) { | ||
3888 | for( i = 0; i < 8; i++ ) { | ||
3889 | if ( ai->config.rates[i] == basic_rate || | ||
3890 | !ai->config.rates ) { | ||
3891 | ai->config.rates[i] = basic_rate | 0x80; | ||
3892 | break; | ||
3893 | } | ||
3894 | } | ||
3895 | } | ||
3896 | set_bit (FLAG_COMMIT, &ai->flags); | 3885 | set_bit (FLAG_COMMIT, &ai->flags); |
3897 | } | 3886 | } |
3898 | 3887 | ||
@@ -3959,7 +3948,7 @@ static u16 issuecommand(struct airo_info *ai, Cmd *pCmd, Resp *pRsp) { | |||
3959 | 3948 | ||
3960 | if ( max_tries == -1 ) { | 3949 | if ( max_tries == -1 ) { |
3961 | airo_print_err(ai->dev->name, | 3950 | airo_print_err(ai->dev->name, |
3962 | "Max tries exceeded when issueing command"); | 3951 | "Max tries exceeded when issuing command"); |
3963 | if (IN4500(ai, COMMAND) & COMMAND_BUSY) | 3952 | if (IN4500(ai, COMMAND) & COMMAND_BUSY) |
3964 | OUT4500(ai, EVACK, EV_CLEARCOMMANDBUSY); | 3953 | OUT4500(ai, EVACK, EV_CLEARCOMMANDBUSY); |
3965 | return ERROR; | 3954 | return ERROR; |
@@ -4185,7 +4174,7 @@ done: | |||
4185 | } | 4174 | } |
4186 | 4175 | ||
4187 | /* Note, that we are using BAP1 which is also used by transmit, so | 4176 | /* Note, that we are using BAP1 which is also used by transmit, so |
4188 | * make sure this isnt called when a transmit is happening */ | 4177 | * make sure this isn't called when a transmit is happening */ |
4189 | static int PC4500_writerid(struct airo_info *ai, u16 rid, | 4178 | static int PC4500_writerid(struct airo_info *ai, u16 rid, |
4190 | const void *pBuf, int len, int lock) | 4179 | const void *pBuf, int len, int lock) |
4191 | { | 4180 | { |
@@ -4430,21 +4419,24 @@ static const struct file_operations proc_statsdelta_ops = { | |||
4430 | .owner = THIS_MODULE, | 4419 | .owner = THIS_MODULE, |
4431 | .read = proc_read, | 4420 | .read = proc_read, |
4432 | .open = proc_statsdelta_open, | 4421 | .open = proc_statsdelta_open, |
4433 | .release = proc_close | 4422 | .release = proc_close, |
4423 | .llseek = default_llseek, | ||
4434 | }; | 4424 | }; |
4435 | 4425 | ||
4436 | static const struct file_operations proc_stats_ops = { | 4426 | static const struct file_operations proc_stats_ops = { |
4437 | .owner = THIS_MODULE, | 4427 | .owner = THIS_MODULE, |
4438 | .read = proc_read, | 4428 | .read = proc_read, |
4439 | .open = proc_stats_open, | 4429 | .open = proc_stats_open, |
4440 | .release = proc_close | 4430 | .release = proc_close, |
4431 | .llseek = default_llseek, | ||
4441 | }; | 4432 | }; |
4442 | 4433 | ||
4443 | static const struct file_operations proc_status_ops = { | 4434 | static const struct file_operations proc_status_ops = { |
4444 | .owner = THIS_MODULE, | 4435 | .owner = THIS_MODULE, |
4445 | .read = proc_read, | 4436 | .read = proc_read, |
4446 | .open = proc_status_open, | 4437 | .open = proc_status_open, |
4447 | .release = proc_close | 4438 | .release = proc_close, |
4439 | .llseek = default_llseek, | ||
4448 | }; | 4440 | }; |
4449 | 4441 | ||
4450 | static const struct file_operations proc_SSID_ops = { | 4442 | static const struct file_operations proc_SSID_ops = { |
@@ -4452,7 +4444,8 @@ static const struct file_operations proc_SSID_ops = { | |||
4452 | .read = proc_read, | 4444 | .read = proc_read, |
4453 | .write = proc_write, | 4445 | .write = proc_write, |
4454 | .open = proc_SSID_open, | 4446 | .open = proc_SSID_open, |
4455 | .release = proc_close | 4447 | .release = proc_close, |
4448 | .llseek = default_llseek, | ||
4456 | }; | 4449 | }; |
4457 | 4450 | ||
4458 | static const struct file_operations proc_BSSList_ops = { | 4451 | static const struct file_operations proc_BSSList_ops = { |
@@ -4460,7 +4453,8 @@ static const struct file_operations proc_BSSList_ops = { | |||
4460 | .read = proc_read, | 4453 | .read = proc_read, |
4461 | .write = proc_write, | 4454 | .write = proc_write, |
4462 | .open = proc_BSSList_open, | 4455 | .open = proc_BSSList_open, |
4463 | .release = proc_close | 4456 | .release = proc_close, |
4457 | .llseek = default_llseek, | ||
4464 | }; | 4458 | }; |
4465 | 4459 | ||
4466 | static const struct file_operations proc_APList_ops = { | 4460 | static const struct file_operations proc_APList_ops = { |
@@ -4468,7 +4462,8 @@ static const struct file_operations proc_APList_ops = { | |||
4468 | .read = proc_read, | 4462 | .read = proc_read, |
4469 | .write = proc_write, | 4463 | .write = proc_write, |
4470 | .open = proc_APList_open, | 4464 | .open = proc_APList_open, |
4471 | .release = proc_close | 4465 | .release = proc_close, |
4466 | .llseek = default_llseek, | ||
4472 | }; | 4467 | }; |
4473 | 4468 | ||
4474 | static const struct file_operations proc_config_ops = { | 4469 | static const struct file_operations proc_config_ops = { |
@@ -4476,7 +4471,8 @@ static const struct file_operations proc_config_ops = { | |||
4476 | .read = proc_read, | 4471 | .read = proc_read, |
4477 | .write = proc_write, | 4472 | .write = proc_write, |
4478 | .open = proc_config_open, | 4473 | .open = proc_config_open, |
4479 | .release = proc_close | 4474 | .release = proc_close, |
4475 | .llseek = default_llseek, | ||
4480 | }; | 4476 | }; |
4481 | 4477 | ||
4482 | static const struct file_operations proc_wepkey_ops = { | 4478 | static const struct file_operations proc_wepkey_ops = { |
@@ -4484,7 +4480,8 @@ static const struct file_operations proc_wepkey_ops = { | |||
4484 | .read = proc_read, | 4480 | .read = proc_read, |
4485 | .write = proc_write, | 4481 | .write = proc_write, |
4486 | .open = proc_wepkey_open, | 4482 | .open = proc_wepkey_open, |
4487 | .release = proc_close | 4483 | .release = proc_close, |
4484 | .llseek = default_llseek, | ||
4488 | }; | 4485 | }; |
4489 | 4486 | ||
4490 | static struct proc_dir_entry *airo_entry; | 4487 | static struct proc_dir_entry *airo_entry; |
@@ -4504,17 +4501,15 @@ static int setup_proc_entry( struct net_device *dev, | |||
4504 | struct proc_dir_entry *entry; | 4501 | struct proc_dir_entry *entry; |
4505 | /* First setup the device directory */ | 4502 | /* First setup the device directory */ |
4506 | strcpy(apriv->proc_name,dev->name); | 4503 | strcpy(apriv->proc_name,dev->name); |
4507 | apriv->proc_entry = create_proc_entry(apriv->proc_name, | 4504 | apriv->proc_entry = proc_mkdir_mode(apriv->proc_name, airo_perm, |
4508 | S_IFDIR|airo_perm, | 4505 | airo_entry); |
4509 | airo_entry); | ||
4510 | if (!apriv->proc_entry) | 4506 | if (!apriv->proc_entry) |
4511 | goto fail; | 4507 | goto fail; |
4512 | apriv->proc_entry->uid = proc_uid; | 4508 | apriv->proc_entry->uid = proc_uid; |
4513 | apriv->proc_entry->gid = proc_gid; | 4509 | apriv->proc_entry->gid = proc_gid; |
4514 | 4510 | ||
4515 | /* Setup the StatsDelta */ | 4511 | /* Setup the StatsDelta */ |
4516 | entry = proc_create_data("StatsDelta", | 4512 | entry = proc_create_data("StatsDelta", S_IRUGO & proc_perm, |
4517 | S_IFREG | (S_IRUGO&proc_perm), | ||
4518 | apriv->proc_entry, &proc_statsdelta_ops, dev); | 4513 | apriv->proc_entry, &proc_statsdelta_ops, dev); |
4519 | if (!entry) | 4514 | if (!entry) |
4520 | goto fail_stats_delta; | 4515 | goto fail_stats_delta; |
@@ -4522,8 +4517,7 @@ static int setup_proc_entry( struct net_device *dev, | |||
4522 | entry->gid = proc_gid; | 4517 | entry->gid = proc_gid; |
4523 | 4518 | ||
4524 | /* Setup the Stats */ | 4519 | /* Setup the Stats */ |
4525 | entry = proc_create_data("Stats", | 4520 | entry = proc_create_data("Stats", S_IRUGO & proc_perm, |
4526 | S_IFREG | (S_IRUGO&proc_perm), | ||
4527 | apriv->proc_entry, &proc_stats_ops, dev); | 4521 | apriv->proc_entry, &proc_stats_ops, dev); |
4528 | if (!entry) | 4522 | if (!entry) |
4529 | goto fail_stats; | 4523 | goto fail_stats; |
@@ -4531,8 +4525,7 @@ static int setup_proc_entry( struct net_device *dev, | |||
4531 | entry->gid = proc_gid; | 4525 | entry->gid = proc_gid; |
4532 | 4526 | ||
4533 | /* Setup the Status */ | 4527 | /* Setup the Status */ |
4534 | entry = proc_create_data("Status", | 4528 | entry = proc_create_data("Status", S_IRUGO & proc_perm, |
4535 | S_IFREG | (S_IRUGO&proc_perm), | ||
4536 | apriv->proc_entry, &proc_status_ops, dev); | 4529 | apriv->proc_entry, &proc_status_ops, dev); |
4537 | if (!entry) | 4530 | if (!entry) |
4538 | goto fail_status; | 4531 | goto fail_status; |
@@ -4540,8 +4533,7 @@ static int setup_proc_entry( struct net_device *dev, | |||
4540 | entry->gid = proc_gid; | 4533 | entry->gid = proc_gid; |
4541 | 4534 | ||
4542 | /* Setup the Config */ | 4535 | /* Setup the Config */ |
4543 | entry = proc_create_data("Config", | 4536 | entry = proc_create_data("Config", proc_perm, |
4544 | S_IFREG | proc_perm, | ||
4545 | apriv->proc_entry, &proc_config_ops, dev); | 4537 | apriv->proc_entry, &proc_config_ops, dev); |
4546 | if (!entry) | 4538 | if (!entry) |
4547 | goto fail_config; | 4539 | goto fail_config; |
@@ -4549,8 +4541,7 @@ static int setup_proc_entry( struct net_device *dev, | |||
4549 | entry->gid = proc_gid; | 4541 | entry->gid = proc_gid; |
4550 | 4542 | ||
4551 | /* Setup the SSID */ | 4543 | /* Setup the SSID */ |
4552 | entry = proc_create_data("SSID", | 4544 | entry = proc_create_data("SSID", proc_perm, |
4553 | S_IFREG | proc_perm, | ||
4554 | apriv->proc_entry, &proc_SSID_ops, dev); | 4545 | apriv->proc_entry, &proc_SSID_ops, dev); |
4555 | if (!entry) | 4546 | if (!entry) |
4556 | goto fail_ssid; | 4547 | goto fail_ssid; |
@@ -4558,8 +4549,7 @@ static int setup_proc_entry( struct net_device *dev, | |||
4558 | entry->gid = proc_gid; | 4549 | entry->gid = proc_gid; |
4559 | 4550 | ||
4560 | /* Setup the APList */ | 4551 | /* Setup the APList */ |
4561 | entry = proc_create_data("APList", | 4552 | entry = proc_create_data("APList", proc_perm, |
4562 | S_IFREG | proc_perm, | ||
4563 | apriv->proc_entry, &proc_APList_ops, dev); | 4553 | apriv->proc_entry, &proc_APList_ops, dev); |
4564 | if (!entry) | 4554 | if (!entry) |
4565 | goto fail_aplist; | 4555 | goto fail_aplist; |
@@ -4567,8 +4557,7 @@ static int setup_proc_entry( struct net_device *dev, | |||
4567 | entry->gid = proc_gid; | 4557 | entry->gid = proc_gid; |
4568 | 4558 | ||
4569 | /* Setup the BSSList */ | 4559 | /* Setup the BSSList */ |
4570 | entry = proc_create_data("BSSList", | 4560 | entry = proc_create_data("BSSList", proc_perm, |
4571 | S_IFREG | proc_perm, | ||
4572 | apriv->proc_entry, &proc_BSSList_ops, dev); | 4561 | apriv->proc_entry, &proc_BSSList_ops, dev); |
4573 | if (!entry) | 4562 | if (!entry) |
4574 | goto fail_bsslist; | 4563 | goto fail_bsslist; |
@@ -4576,8 +4565,7 @@ static int setup_proc_entry( struct net_device *dev, | |||
4576 | entry->gid = proc_gid; | 4565 | entry->gid = proc_gid; |
4577 | 4566 | ||
4578 | /* Setup the WepKey */ | 4567 | /* Setup the WepKey */ |
4579 | entry = proc_create_data("WepKey", | 4568 | entry = proc_create_data("WepKey", proc_perm, |
4580 | S_IFREG | proc_perm, | ||
4581 | apriv->proc_entry, &proc_wepkey_ops, dev); | 4569 | apriv->proc_entry, &proc_wepkey_ops, dev); |
4582 | if (!entry) | 4570 | if (!entry) |
4583 | goto fail_wepkey; | 4571 | goto fail_wepkey; |
@@ -4656,24 +4644,18 @@ static ssize_t proc_write( struct file *file, | |||
4656 | size_t len, | 4644 | size_t len, |
4657 | loff_t *offset ) | 4645 | loff_t *offset ) |
4658 | { | 4646 | { |
4659 | loff_t pos = *offset; | 4647 | ssize_t ret; |
4660 | struct proc_data *priv = file->private_data; | 4648 | struct proc_data *priv = file->private_data; |
4661 | 4649 | ||
4662 | if (!priv->wbuffer) | 4650 | if (!priv->wbuffer) |
4663 | return -EINVAL; | 4651 | return -EINVAL; |
4664 | 4652 | ||
4665 | if (pos < 0) | 4653 | ret = simple_write_to_buffer(priv->wbuffer, priv->maxwritelen, offset, |
4666 | return -EINVAL; | 4654 | buffer, len); |
4667 | if (pos >= priv->maxwritelen) | 4655 | if (ret > 0) |
4668 | return 0; | 4656 | priv->writelen = max_t(int, priv->writelen, *offset); |
4669 | if (len > priv->maxwritelen - pos) | 4657 | |
4670 | len = priv->maxwritelen - pos; | 4658 | return ret; |
4671 | if (copy_from_user(priv->wbuffer + pos, buffer, len)) | ||
4672 | return -EFAULT; | ||
4673 | if ( pos + len > priv->writelen ) | ||
4674 | priv->writelen = len + file->f_pos; | ||
4675 | *offset = pos + len; | ||
4676 | return len; | ||
4677 | } | 4659 | } |
4678 | 4660 | ||
4679 | static int proc_status_open(struct inode *inode, struct file *file) | 4661 | static int proc_status_open(struct inode *inode, struct file *file) |
@@ -4786,7 +4768,7 @@ static int proc_stats_rid_open( struct inode *inode, | |||
4786 | if (!statsLabels[i]) continue; | 4768 | if (!statsLabels[i]) continue; |
4787 | if (j+strlen(statsLabels[i])+16>4096) { | 4769 | if (j+strlen(statsLabels[i])+16>4096) { |
4788 | airo_print_warn(apriv->dev->name, | 4770 | airo_print_warn(apriv->dev->name, |
4789 | "Potentially disasterous buffer overflow averted!"); | 4771 | "Potentially disastrous buffer overflow averted!"); |
4790 | break; | 4772 | break; |
4791 | } | 4773 | } |
4792 | j+=sprintf(data->rbuffer+j, "%s: %u\n", statsLabels[i], | 4774 | j+=sprintf(data->rbuffer+j, "%s: %u\n", statsLabels[i], |
@@ -5024,7 +5006,7 @@ static void proc_config_on_close(struct inode *inode, struct file *file) | |||
5024 | airo_config_commit(dev, NULL, NULL, NULL); | 5006 | airo_config_commit(dev, NULL, NULL, NULL); |
5025 | } | 5007 | } |
5026 | 5008 | ||
5027 | static char *get_rmode(__le16 mode) | 5009 | static const char *get_rmode(__le16 mode) |
5028 | { | 5010 | { |
5029 | switch(mode & RXMODE_MASK) { | 5011 | switch(mode & RXMODE_MASK) { |
5030 | case RXMODE_RFMON: return "rfmon"; | 5012 | case RXMODE_RFMON: return "rfmon"; |
@@ -5715,9 +5697,7 @@ static int __init airo_init_module( void ) | |||
5715 | { | 5697 | { |
5716 | int i; | 5698 | int i; |
5717 | 5699 | ||
5718 | airo_entry = create_proc_entry("driver/aironet", | 5700 | airo_entry = proc_mkdir_mode("driver/aironet", airo_perm, NULL); |
5719 | S_IFDIR | airo_perm, | ||
5720 | NULL); | ||
5721 | 5701 | ||
5722 | if (airo_entry) { | 5702 | if (airo_entry) { |
5723 | airo_entry->uid = proc_uid; | 5703 | airo_entry->uid = proc_uid; |