diff options
-rw-r--r-- | drivers/net/wireless/Kconfig | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2100.c | 126 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2100.h | 91 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2200.c | 169 | ||||
-rw-r--r-- | net/ieee80211/ieee80211_module.c | 1 | ||||
-rw-r--r-- | net/ieee80211/ieee80211_rx.c | 1 | ||||
-rw-r--r-- | net/ieee80211/ieee80211_tx.c | 1 |
7 files changed, 155 insertions, 237 deletions
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig index a4a7e8a41775..ff5b1b1de2fa 100644 --- a/drivers/net/wireless/Kconfig +++ b/drivers/net/wireless/Kconfig | |||
@@ -192,9 +192,8 @@ config IPW_DEBUG | |||
192 | 192 | ||
193 | config IPW2200 | 193 | config IPW2200 |
194 | tristate "Intel PRO/Wireless 2200BG and 2915ABG Network Connection" | 194 | tristate "Intel PRO/Wireless 2200BG and 2915ABG Network Connection" |
195 | depends on NET_RADIO && PCI | 195 | depends on IEEE80211 && PCI |
196 | select FW_LOADER | 196 | select FW_LOADER |
197 | select IEEE80211 | ||
198 | ---help--- | 197 | ---help--- |
199 | A driver for the Intel PRO/Wireless 2200BG and 2915ABG Network | 198 | A driver for the Intel PRO/Wireless 2200BG and 2915ABG Network |
200 | Connection adapters. | 199 | Connection adapters. |
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index d296d464946f..189ad7b2cec9 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c | |||
@@ -146,6 +146,7 @@ that only one external action is invoked at a time. | |||
146 | #include <linux/netdevice.h> | 146 | #include <linux/netdevice.h> |
147 | #include <linux/ethtool.h> | 147 | #include <linux/ethtool.h> |
148 | #include <linux/pci.h> | 148 | #include <linux/pci.h> |
149 | #include <linux/dma-mapping.h> | ||
149 | #include <linux/proc_fs.h> | 150 | #include <linux/proc_fs.h> |
150 | #include <linux/skbuff.h> | 151 | #include <linux/skbuff.h> |
151 | #include <asm/uaccess.h> | 152 | #include <asm/uaccess.h> |
@@ -493,7 +494,7 @@ int ipw2100_get_ordinal(struct ipw2100_priv *priv, u32 ord, | |||
493 | *len = IPW_ORD_TAB_1_ENTRY_SIZE; | 494 | *len = IPW_ORD_TAB_1_ENTRY_SIZE; |
494 | 495 | ||
495 | IPW_DEBUG_WARNING(DRV_NAME | 496 | IPW_DEBUG_WARNING(DRV_NAME |
496 | ": ordinal buffer length too small, need %d\n", | 497 | ": ordinal buffer length too small, need %zd\n", |
497 | IPW_ORD_TAB_1_ENTRY_SIZE); | 498 | IPW_ORD_TAB_1_ENTRY_SIZE); |
498 | 499 | ||
499 | return -EINVAL; | 500 | return -EINVAL; |
@@ -915,18 +916,16 @@ static int sw_reset_and_clock(struct ipw2100_priv *priv) | |||
915 | if (i == 10000) | 916 | if (i == 10000) |
916 | return -EIO; /* TODO: better error value */ | 917 | return -EIO; /* TODO: better error value */ |
917 | 918 | ||
918 | //#if CONFIG_IPW2100_D0ENABLED | ||
919 | /* set D0 standby bit */ | 919 | /* set D0 standby bit */ |
920 | read_register(priv->net_dev, IPW_REG_GP_CNTRL, &r); | 920 | read_register(priv->net_dev, IPW_REG_GP_CNTRL, &r); |
921 | write_register(priv->net_dev, IPW_REG_GP_CNTRL, | 921 | write_register(priv->net_dev, IPW_REG_GP_CNTRL, |
922 | r | IPW_AUX_HOST_GP_CNTRL_BIT_HOST_ALLOWS_STANDBY); | 922 | r | IPW_AUX_HOST_GP_CNTRL_BIT_HOST_ALLOWS_STANDBY); |
923 | //#endif | ||
924 | 923 | ||
925 | return 0; | 924 | return 0; |
926 | } | 925 | } |
927 | 926 | ||
928 | /********************************************************************* | 927 | /********************************************************************* |
929 | Procedure : ipw2100_ipw2100_download_firmware | 928 | Procedure : ipw2100_download_firmware |
930 | Purpose : Initiaze adapter after power on. | 929 | Purpose : Initiaze adapter after power on. |
931 | The sequence is: | 930 | The sequence is: |
932 | 1. assert s/w reset first! | 931 | 1. assert s/w reset first! |
@@ -1117,7 +1116,6 @@ static inline int rf_kill_active(struct ipw2100_priv *priv) | |||
1117 | { | 1116 | { |
1118 | #define MAX_RF_KILL_CHECKS 5 | 1117 | #define MAX_RF_KILL_CHECKS 5 |
1119 | #define RF_KILL_CHECK_DELAY 40 | 1118 | #define RF_KILL_CHECK_DELAY 40 |
1120 | #define RF_KILL_CHECK_THRESHOLD 3 | ||
1121 | 1119 | ||
1122 | unsigned short value = 0; | 1120 | unsigned short value = 0; |
1123 | u32 reg = 0; | 1121 | u32 reg = 0; |
@@ -1194,7 +1192,6 @@ static int ipw2100_get_hw_features(struct ipw2100_priv *priv) | |||
1194 | */ | 1192 | */ |
1195 | static int ipw2100_start_adapter(struct ipw2100_priv *priv) | 1193 | static int ipw2100_start_adapter(struct ipw2100_priv *priv) |
1196 | { | 1194 | { |
1197 | #define IPW_WAIT_FW_INIT_COMPLETE_DELAY (40 * HZ / 1000) | ||
1198 | int i; | 1195 | int i; |
1199 | u32 inta, inta_mask, gpio; | 1196 | u32 inta, inta_mask, gpio; |
1200 | 1197 | ||
@@ -1231,7 +1228,7 @@ static int ipw2100_start_adapter(struct ipw2100_priv *priv) | |||
1231 | i = 5000; | 1228 | i = 5000; |
1232 | do { | 1229 | do { |
1233 | set_current_state(TASK_UNINTERRUPTIBLE); | 1230 | set_current_state(TASK_UNINTERRUPTIBLE); |
1234 | schedule_timeout(IPW_WAIT_FW_INIT_COMPLETE_DELAY); | 1231 | schedule_timeout(40 * HZ / 1000); |
1235 | /* Todo... wait for sync command ... */ | 1232 | /* Todo... wait for sync command ... */ |
1236 | 1233 | ||
1237 | read_register(priv->net_dev, IPW_REG_INTA, &inta); | 1234 | read_register(priv->net_dev, IPW_REG_INTA, &inta); |
@@ -1696,7 +1693,7 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred) | |||
1696 | } else | 1693 | } else |
1697 | priv->status |= STATUS_POWERED; | 1694 | priv->status |= STATUS_POWERED; |
1698 | 1695 | ||
1699 | /* Load the firmeware, start the clocks, etc. */ | 1696 | /* Load the firmware, start the clocks, etc. */ |
1700 | if (ipw2100_start_adapter(priv)) { | 1697 | if (ipw2100_start_adapter(priv)) { |
1701 | IPW_DEBUG_ERROR("%s: Failed to start the firmware.\n", | 1698 | IPW_DEBUG_ERROR("%s: Failed to start the firmware.\n", |
1702 | priv->net_dev->name); | 1699 | priv->net_dev->name); |
@@ -2302,7 +2299,7 @@ static inline void ipw2100_corruption_detected(struct ipw2100_priv *priv, | |||
2302 | #endif | 2299 | #endif |
2303 | 2300 | ||
2304 | IPW_DEBUG_INFO(DRV_NAME ": PCI latency error detected at " | 2301 | IPW_DEBUG_INFO(DRV_NAME ": PCI latency error detected at " |
2305 | "0x%04X.\n", i * sizeof(struct ipw2100_status)); | 2302 | "0x%04zX.\n", i * sizeof(struct ipw2100_status)); |
2306 | 2303 | ||
2307 | #ifdef ACPI_CSTATE_LIMIT_DEFINED | 2304 | #ifdef ACPI_CSTATE_LIMIT_DEFINED |
2308 | IPW_DEBUG_INFO(DRV_NAME ": Disabling C3 transitions.\n"); | 2305 | IPW_DEBUG_INFO(DRV_NAME ": Disabling C3 transitions.\n"); |
@@ -2398,7 +2395,7 @@ static inline void isr_rx(struct ipw2100_priv *priv, int i, | |||
2398 | /* Make a copy of the frame so we can dump it to the logs if | 2395 | /* Make a copy of the frame so we can dump it to the logs if |
2399 | * ieee80211_rx fails */ | 2396 | * ieee80211_rx fails */ |
2400 | memcpy(packet_data, packet->skb->data, | 2397 | memcpy(packet_data, packet->skb->data, |
2401 | min(status->frame_size, IPW_RX_NIC_BUFFER_LENGTH)); | 2398 | min_t(u32, status->frame_size, IPW_RX_NIC_BUFFER_LENGTH)); |
2402 | #endif | 2399 | #endif |
2403 | 2400 | ||
2404 | if (!ieee80211_rx(priv->ieee, packet->skb, stats)) { | 2401 | if (!ieee80211_rx(priv->ieee, packet->skb, stats)) { |
@@ -2730,21 +2727,21 @@ static inline int __ipw2100_tx_process(struct ipw2100_priv *priv) | |||
2730 | { | 2727 | { |
2731 | int i = txq->oldest; | 2728 | int i = txq->oldest; |
2732 | IPW_DEBUG_TX( | 2729 | IPW_DEBUG_TX( |
2733 | "TX%d V=%p P=%p T=%p L=%d\n", i, | 2730 | "TX%d V=%p P=%04X T=%04X L=%d\n", i, |
2734 | &txq->drv[i], | 2731 | &txq->drv[i], |
2735 | (void*)txq->nic + i * sizeof(struct ipw2100_bd), | 2732 | (u32)(txq->nic + i * sizeof(struct ipw2100_bd)), |
2736 | (void*)txq->drv[i].host_addr, | 2733 | txq->drv[i].host_addr, |
2737 | txq->drv[i].buf_length); | 2734 | txq->drv[i].buf_length); |
2738 | 2735 | ||
2739 | if (packet->type == DATA) { | 2736 | if (packet->type == DATA) { |
2740 | i = (i + 1) % txq->entries; | 2737 | i = (i + 1) % txq->entries; |
2741 | 2738 | ||
2742 | IPW_DEBUG_TX( | 2739 | IPW_DEBUG_TX( |
2743 | "TX%d V=%p P=%p T=%p L=%d\n", i, | 2740 | "TX%d V=%p P=%04X T=%04X L=%d\n", i, |
2744 | &txq->drv[i], | 2741 | &txq->drv[i], |
2745 | (void*)txq->nic + i * | 2742 | (u32)(txq->nic + i * |
2746 | sizeof(struct ipw2100_bd), | 2743 | sizeof(struct ipw2100_bd)), |
2747 | (void*)txq->drv[i].host_addr, | 2744 | (u32)txq->drv[i].host_addr, |
2748 | txq->drv[i].buf_length); | 2745 | txq->drv[i].buf_length); |
2749 | } | 2746 | } |
2750 | } | 2747 | } |
@@ -3383,7 +3380,8 @@ static void ipw2100_msg_free(struct ipw2100_priv *priv) | |||
3383 | priv->msg_buffers = NULL; | 3380 | priv->msg_buffers = NULL; |
3384 | } | 3381 | } |
3385 | 3382 | ||
3386 | static ssize_t show_pci(struct device *d, char *buf) | 3383 | static ssize_t show_pci(struct device *d, struct device_attribute *attr, |
3384 | char *buf) | ||
3387 | { | 3385 | { |
3388 | struct pci_dev *pci_dev = container_of(d, struct pci_dev, dev); | 3386 | struct pci_dev *pci_dev = container_of(d, struct pci_dev, dev); |
3389 | char *out = buf; | 3387 | char *out = buf; |
@@ -3403,23 +3401,26 @@ static ssize_t show_pci(struct device *d, char *buf) | |||
3403 | } | 3401 | } |
3404 | static DEVICE_ATTR(pci, S_IRUGO, show_pci, NULL); | 3402 | static DEVICE_ATTR(pci, S_IRUGO, show_pci, NULL); |
3405 | 3403 | ||
3406 | static ssize_t show_cfg(struct device *d, char *buf) | 3404 | static ssize_t show_cfg(struct device *d, struct device_attribute *attr, |
3405 | char *buf) | ||
3407 | { | 3406 | { |
3408 | struct ipw2100_priv *p = (struct ipw2100_priv *)d->driver_data; | 3407 | struct ipw2100_priv *p = d->driver_data; |
3409 | return sprintf(buf, "0x%08x\n", (int)p->config); | 3408 | return sprintf(buf, "0x%08x\n", (int)p->config); |
3410 | } | 3409 | } |
3411 | static DEVICE_ATTR(cfg, S_IRUGO, show_cfg, NULL); | 3410 | static DEVICE_ATTR(cfg, S_IRUGO, show_cfg, NULL); |
3412 | 3411 | ||
3413 | static ssize_t show_status(struct device *d, char *buf) | 3412 | static ssize_t show_status(struct device *d, struct device_attribute *attr, |
3413 | char *buf) | ||
3414 | { | 3414 | { |
3415 | struct ipw2100_priv *p = (struct ipw2100_priv *)d->driver_data; | 3415 | struct ipw2100_priv *p = d->driver_data; |
3416 | return sprintf(buf, "0x%08x\n", (int)p->status); | 3416 | return sprintf(buf, "0x%08x\n", (int)p->status); |
3417 | } | 3417 | } |
3418 | static DEVICE_ATTR(status, S_IRUGO, show_status, NULL); | 3418 | static DEVICE_ATTR(status, S_IRUGO, show_status, NULL); |
3419 | 3419 | ||
3420 | static ssize_t show_capability(struct device *d, char *buf) | 3420 | static ssize_t show_capability(struct device *d, struct device_attribute *attr, |
3421 | char *buf) | ||
3421 | { | 3422 | { |
3422 | struct ipw2100_priv *p = (struct ipw2100_priv *)d->driver_data; | 3423 | struct ipw2100_priv *p = d->driver_data; |
3423 | return sprintf(buf, "0x%08x\n", (int)p->capability); | 3424 | return sprintf(buf, "0x%08x\n", (int)p->capability); |
3424 | } | 3425 | } |
3425 | static DEVICE_ATTR(capability, S_IRUGO, show_capability, NULL); | 3426 | static DEVICE_ATTR(capability, S_IRUGO, show_capability, NULL); |
@@ -3602,7 +3603,8 @@ const struct { | |||
3602 | }; | 3603 | }; |
3603 | 3604 | ||
3604 | 3605 | ||
3605 | static ssize_t show_registers(struct device *d, char *buf) | 3606 | static ssize_t show_registers(struct device *d, struct device_attribute *attr, |
3607 | char *buf) | ||
3606 | { | 3608 | { |
3607 | int i; | 3609 | int i; |
3608 | struct ipw2100_priv *priv = dev_get_drvdata(d); | 3610 | struct ipw2100_priv *priv = dev_get_drvdata(d); |
@@ -3623,7 +3625,8 @@ static ssize_t show_registers(struct device *d, char *buf) | |||
3623 | static DEVICE_ATTR(registers, S_IRUGO, show_registers, NULL); | 3625 | static DEVICE_ATTR(registers, S_IRUGO, show_registers, NULL); |
3624 | 3626 | ||
3625 | 3627 | ||
3626 | static ssize_t show_hardware(struct device *d, char *buf) | 3628 | static ssize_t show_hardware(struct device *d, struct device_attribute *attr, |
3629 | char *buf) | ||
3627 | { | 3630 | { |
3628 | struct ipw2100_priv *priv = dev_get_drvdata(d); | 3631 | struct ipw2100_priv *priv = dev_get_drvdata(d); |
3629 | struct net_device *dev = priv->net_dev; | 3632 | struct net_device *dev = priv->net_dev; |
@@ -3663,7 +3666,8 @@ static ssize_t show_hardware(struct device *d, char *buf) | |||
3663 | static DEVICE_ATTR(hardware, S_IRUGO, show_hardware, NULL); | 3666 | static DEVICE_ATTR(hardware, S_IRUGO, show_hardware, NULL); |
3664 | 3667 | ||
3665 | 3668 | ||
3666 | static ssize_t show_memory(struct device *d, char *buf) | 3669 | static ssize_t show_memory(struct device *d, struct device_attribute *attr, |
3670 | char *buf) | ||
3667 | { | 3671 | { |
3668 | struct ipw2100_priv *priv = dev_get_drvdata(d); | 3672 | struct ipw2100_priv *priv = dev_get_drvdata(d); |
3669 | struct net_device *dev = priv->net_dev; | 3673 | struct net_device *dev = priv->net_dev; |
@@ -3716,7 +3720,8 @@ static ssize_t show_memory(struct device *d, char *buf) | |||
3716 | return len; | 3720 | return len; |
3717 | } | 3721 | } |
3718 | 3722 | ||
3719 | static ssize_t store_memory(struct device *d, const char *buf, size_t count) | 3723 | static ssize_t store_memory(struct device *d, struct device_attribute *attr, |
3724 | const char *buf, size_t count) | ||
3720 | { | 3725 | { |
3721 | struct ipw2100_priv *priv = dev_get_drvdata(d); | 3726 | struct ipw2100_priv *priv = dev_get_drvdata(d); |
3722 | struct net_device *dev = priv->net_dev; | 3727 | struct net_device *dev = priv->net_dev; |
@@ -3752,7 +3757,8 @@ static ssize_t store_memory(struct device *d, const char *buf, size_t count) | |||
3752 | static DEVICE_ATTR(memory, S_IWUSR|S_IRUGO, show_memory, store_memory); | 3757 | static DEVICE_ATTR(memory, S_IWUSR|S_IRUGO, show_memory, store_memory); |
3753 | 3758 | ||
3754 | 3759 | ||
3755 | static ssize_t show_ordinals(struct device *d, char *buf) | 3760 | static ssize_t show_ordinals(struct device *d, struct device_attribute *attr, |
3761 | char *buf) | ||
3756 | { | 3762 | { |
3757 | struct ipw2100_priv *priv = dev_get_drvdata(d); | 3763 | struct ipw2100_priv *priv = dev_get_drvdata(d); |
3758 | u32 val = 0; | 3764 | u32 val = 0; |
@@ -3786,7 +3792,8 @@ static ssize_t show_ordinals(struct device *d, char *buf) | |||
3786 | static DEVICE_ATTR(ordinals, S_IRUGO, show_ordinals, NULL); | 3792 | static DEVICE_ATTR(ordinals, S_IRUGO, show_ordinals, NULL); |
3787 | 3793 | ||
3788 | 3794 | ||
3789 | static ssize_t show_stats(struct device *d, char *buf) | 3795 | static ssize_t show_stats(struct device *d, struct device_attribute *attr, |
3796 | char *buf) | ||
3790 | { | 3797 | { |
3791 | struct ipw2100_priv *priv = dev_get_drvdata(d); | 3798 | struct ipw2100_priv *priv = dev_get_drvdata(d); |
3792 | char * out = buf; | 3799 | char * out = buf; |
@@ -3851,7 +3858,8 @@ int ipw2100_switch_mode(struct ipw2100_priv *priv, u32 mode) | |||
3851 | return 0; | 3858 | return 0; |
3852 | } | 3859 | } |
3853 | 3860 | ||
3854 | static ssize_t show_internals(struct device *d, char *buf) | 3861 | static ssize_t show_internals(struct device *d, struct device_attribute *attr, |
3862 | char *buf) | ||
3855 | { | 3863 | { |
3856 | struct ipw2100_priv *priv = dev_get_drvdata(d); | 3864 | struct ipw2100_priv *priv = dev_get_drvdata(d); |
3857 | int len = 0; | 3865 | int len = 0; |
@@ -3902,7 +3910,8 @@ static ssize_t show_internals(struct device *d, char *buf) | |||
3902 | static DEVICE_ATTR(internals, S_IRUGO, show_internals, NULL); | 3910 | static DEVICE_ATTR(internals, S_IRUGO, show_internals, NULL); |
3903 | 3911 | ||
3904 | 3912 | ||
3905 | static ssize_t show_bssinfo(struct device *d, char *buf) | 3913 | static ssize_t show_bssinfo(struct device *d, struct device_attribute *attr, |
3914 | char *buf) | ||
3906 | { | 3915 | { |
3907 | struct ipw2100_priv *priv = dev_get_drvdata(d); | 3916 | struct ipw2100_priv *priv = dev_get_drvdata(d); |
3908 | char essid[IW_ESSID_MAX_SIZE + 1]; | 3917 | char essid[IW_ESSID_MAX_SIZE + 1]; |
@@ -3945,8 +3954,6 @@ static ssize_t show_bssinfo(struct device *d, char *buf) | |||
3945 | static DEVICE_ATTR(bssinfo, S_IRUGO, show_bssinfo, NULL); | 3954 | static DEVICE_ATTR(bssinfo, S_IRUGO, show_bssinfo, NULL); |
3946 | 3955 | ||
3947 | 3956 | ||
3948 | |||
3949 | |||
3950 | #ifdef CONFIG_IPW_DEBUG | 3957 | #ifdef CONFIG_IPW_DEBUG |
3951 | static ssize_t show_debug_level(struct device_driver *d, char *buf) | 3958 | static ssize_t show_debug_level(struct device_driver *d, char *buf) |
3952 | { | 3959 | { |
@@ -3979,7 +3986,8 @@ static DRIVER_ATTR(debug_level, S_IWUSR | S_IRUGO, show_debug_level, | |||
3979 | #endif /* CONFIG_IPW_DEBUG */ | 3986 | #endif /* CONFIG_IPW_DEBUG */ |
3980 | 3987 | ||
3981 | 3988 | ||
3982 | static ssize_t show_fatal_error(struct device *d, char *buf) | 3989 | static ssize_t show_fatal_error(struct device *d, |
3990 | struct device_attribute *attr, char *buf) | ||
3983 | { | 3991 | { |
3984 | struct ipw2100_priv *priv = dev_get_drvdata(d); | 3992 | struct ipw2100_priv *priv = dev_get_drvdata(d); |
3985 | char *out = buf; | 3993 | char *out = buf; |
@@ -4004,8 +4012,8 @@ static ssize_t show_fatal_error(struct device *d, char *buf) | |||
4004 | return out - buf; | 4012 | return out - buf; |
4005 | } | 4013 | } |
4006 | 4014 | ||
4007 | static ssize_t store_fatal_error(struct device *d, const char *buf, | 4015 | static ssize_t store_fatal_error(struct device *d, |
4008 | size_t count) | 4016 | struct device_attribute *attr, const char *buf, size_t count) |
4009 | { | 4017 | { |
4010 | struct ipw2100_priv *priv = dev_get_drvdata(d); | 4018 | struct ipw2100_priv *priv = dev_get_drvdata(d); |
4011 | schedule_reset(priv); | 4019 | schedule_reset(priv); |
@@ -4014,13 +4022,15 @@ static ssize_t store_fatal_error(struct device *d, const char *buf, | |||
4014 | static DEVICE_ATTR(fatal_error, S_IWUSR|S_IRUGO, show_fatal_error, store_fatal_error); | 4022 | static DEVICE_ATTR(fatal_error, S_IWUSR|S_IRUGO, show_fatal_error, store_fatal_error); |
4015 | 4023 | ||
4016 | 4024 | ||
4017 | static ssize_t show_scan_age(struct device *d, char *buf) | 4025 | static ssize_t show_scan_age(struct device *d, struct device_attribute *attr, |
4026 | char *buf) | ||
4018 | { | 4027 | { |
4019 | struct ipw2100_priv *priv = dev_get_drvdata(d); | 4028 | struct ipw2100_priv *priv = dev_get_drvdata(d); |
4020 | return sprintf(buf, "%d\n", priv->ieee->scan_age); | 4029 | return sprintf(buf, "%d\n", priv->ieee->scan_age); |
4021 | } | 4030 | } |
4022 | 4031 | ||
4023 | static ssize_t store_scan_age(struct device *d, const char *buf, size_t count) | 4032 | static ssize_t store_scan_age(struct device *d, struct device_attribute *attr, |
4033 | const char *buf, size_t count) | ||
4024 | { | 4034 | { |
4025 | struct ipw2100_priv *priv = dev_get_drvdata(d); | 4035 | struct ipw2100_priv *priv = dev_get_drvdata(d); |
4026 | struct net_device *dev = priv->net_dev; | 4036 | struct net_device *dev = priv->net_dev; |
@@ -4056,7 +4066,8 @@ static ssize_t store_scan_age(struct device *d, const char *buf, size_t count) | |||
4056 | static DEVICE_ATTR(scan_age, S_IWUSR | S_IRUGO, show_scan_age, store_scan_age); | 4066 | static DEVICE_ATTR(scan_age, S_IWUSR | S_IRUGO, show_scan_age, store_scan_age); |
4057 | 4067 | ||
4058 | 4068 | ||
4059 | static ssize_t show_rf_kill(struct device *d, char *buf) | 4069 | static ssize_t show_rf_kill(struct device *d, struct device_attribute *attr, |
4070 | char *buf) | ||
4060 | { | 4071 | { |
4061 | /* 0 - RF kill not enabled | 4072 | /* 0 - RF kill not enabled |
4062 | 1 - SW based RF kill active (sysfs) | 4073 | 1 - SW based RF kill active (sysfs) |
@@ -4100,7 +4111,8 @@ static int ipw_radio_kill_sw(struct ipw2100_priv *priv, int disable_radio) | |||
4100 | return 1; | 4111 | return 1; |
4101 | } | 4112 | } |
4102 | 4113 | ||
4103 | static ssize_t store_rf_kill(struct device *d, const char *buf, size_t count) | 4114 | static ssize_t store_rf_kill(struct device *d, struct device_attribute *attr, |
4115 | const char *buf, size_t count) | ||
4104 | { | 4116 | { |
4105 | struct ipw2100_priv *priv = dev_get_drvdata(d); | 4117 | struct ipw2100_priv *priv = dev_get_drvdata(d); |
4106 | ipw_radio_kill_sw(priv, buf[0] == '1'); | 4118 | ipw_radio_kill_sw(priv, buf[0] == '1'); |
@@ -4212,7 +4224,7 @@ static void bd_queue_initialize( | |||
4212 | { | 4224 | { |
4213 | IPW_DEBUG_INFO("enter\n"); | 4225 | IPW_DEBUG_INFO("enter\n"); |
4214 | 4226 | ||
4215 | IPW_DEBUG_INFO("initializing bd queue at virt=%p, phys=%08x\n", q->drv, q->nic); | 4227 | IPW_DEBUG_INFO("initializing bd queue at virt=%p, phys=%08x\n", q->drv, (u32)q->nic); |
4216 | 4228 | ||
4217 | write_register(priv->net_dev, base, q->nic); | 4229 | write_register(priv->net_dev, base, q->nic); |
4218 | write_register(priv->net_dev, size, q->entries); | 4230 | write_register(priv->net_dev, size, q->entries); |
@@ -5308,7 +5320,7 @@ static int ipw2100_set_key_index(struct ipw2100_priv *priv, | |||
5308 | .host_command = WEP_KEY_INDEX, | 5320 | .host_command = WEP_KEY_INDEX, |
5309 | .host_command_sequence = 0, | 5321 | .host_command_sequence = 0, |
5310 | .host_command_length = 4, | 5322 | .host_command_length = 4, |
5311 | .host_command_parameters[0] = idx, | 5323 | .host_command_parameters = { idx }, |
5312 | }; | 5324 | }; |
5313 | int err; | 5325 | int err; |
5314 | 5326 | ||
@@ -6425,10 +6437,6 @@ static struct net_device *ipw2100_alloc_device( | |||
6425 | return dev; | 6437 | return dev; |
6426 | } | 6438 | } |
6427 | 6439 | ||
6428 | |||
6429 | |||
6430 | #define PCI_DMA_32BIT 0x00000000ffffffffULL | ||
6431 | |||
6432 | static int ipw2100_pci_init_one(struct pci_dev *pci_dev, | 6440 | static int ipw2100_pci_init_one(struct pci_dev *pci_dev, |
6433 | const struct pci_device_id *ent) | 6441 | const struct pci_device_id *ent) |
6434 | { | 6442 | { |
@@ -6482,7 +6490,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev, | |||
6482 | pci_set_master(pci_dev); | 6490 | pci_set_master(pci_dev); |
6483 | pci_set_drvdata(pci_dev, priv); | 6491 | pci_set_drvdata(pci_dev, priv); |
6484 | 6492 | ||
6485 | err = pci_set_dma_mask(pci_dev, PCI_DMA_32BIT); | 6493 | err = pci_set_dma_mask(pci_dev, DMA_32BIT_MASK); |
6486 | if (err) { | 6494 | if (err) { |
6487 | printk(KERN_WARNING DRV_NAME | 6495 | printk(KERN_WARNING DRV_NAME |
6488 | "Error calling pci_set_dma_mask.\n"); | 6496 | "Error calling pci_set_dma_mask.\n"); |
@@ -6504,7 +6512,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev, | |||
6504 | if ((val & 0x0000ff00) != 0) | 6512 | if ((val & 0x0000ff00) != 0) |
6505 | pci_write_config_dword(pci_dev, 0x40, val & 0xffff00ff); | 6513 | pci_write_config_dword(pci_dev, 0x40, val & 0xffff00ff); |
6506 | 6514 | ||
6507 | pci_set_power_state(pci_dev, 0); | 6515 | pci_set_power_state(pci_dev, PCI_D0); |
6508 | 6516 | ||
6509 | if (!ipw2100_hw_is_adapter_in_system(dev)) { | 6517 | if (!ipw2100_hw_is_adapter_in_system(dev)) { |
6510 | printk(KERN_WARNING DRV_NAME | 6518 | printk(KERN_WARNING DRV_NAME |
@@ -6707,17 +6715,9 @@ static int ipw2100_suspend(struct pci_dev *pci_dev, pm_message_t state) | |||
6707 | /* Remove the PRESENT state of the device */ | 6715 | /* Remove the PRESENT state of the device */ |
6708 | netif_device_detach(dev); | 6716 | netif_device_detach(dev); |
6709 | 6717 | ||
6710 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) | ||
6711 | pci_save_state(pci_dev, priv->pm_state); | ||
6712 | #else | ||
6713 | pci_save_state(pci_dev); | 6718 | pci_save_state(pci_dev); |
6714 | #endif | ||
6715 | pci_disable_device (pci_dev); | 6719 | pci_disable_device (pci_dev); |
6716 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11) | ||
6717 | pci_set_power_state(pci_dev, state); | ||
6718 | #else | ||
6719 | pci_set_power_state(pci_dev, PCI_D3hot); | 6720 | pci_set_power_state(pci_dev, PCI_D3hot); |
6720 | #endif | ||
6721 | 6721 | ||
6722 | up(&priv->action_sem); | 6722 | up(&priv->action_sem); |
6723 | 6723 | ||
@@ -6738,17 +6738,9 @@ static int ipw2100_resume(struct pci_dev *pci_dev) | |||
6738 | IPW_DEBUG_INFO("%s: Coming out of suspend...\n", | 6738 | IPW_DEBUG_INFO("%s: Coming out of suspend...\n", |
6739 | dev->name); | 6739 | dev->name); |
6740 | 6740 | ||
6741 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11) | ||
6742 | pci_set_power_state(pci_dev, 0); | ||
6743 | #else | ||
6744 | pci_set_power_state(pci_dev, PCI_D0); | 6741 | pci_set_power_state(pci_dev, PCI_D0); |
6745 | #endif | ||
6746 | pci_enable_device(pci_dev); | 6742 | pci_enable_device(pci_dev); |
6747 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) | ||
6748 | pci_restore_state(pci_dev, priv->pm_state); | ||
6749 | #else | ||
6750 | pci_restore_state(pci_dev); | 6743 | pci_restore_state(pci_dev); |
6751 | #endif | ||
6752 | 6744 | ||
6753 | /* | 6745 | /* |
6754 | * Suspend/Resume resets the PCI configuration space, so we have to | 6746 | * Suspend/Resume resets the PCI configuration space, so we have to |
@@ -8056,7 +8048,7 @@ static iw_handler ipw2100_wx_handlers[] = | |||
8056 | ipw2100_wx_set_wap, /* SIOCSIWAP */ | 8048 | ipw2100_wx_set_wap, /* SIOCSIWAP */ |
8057 | ipw2100_wx_get_wap, /* SIOCGIWAP */ | 8049 | ipw2100_wx_get_wap, /* SIOCGIWAP */ |
8058 | NULL, /* -- hole -- */ | 8050 | NULL, /* -- hole -- */ |
8059 | NULL, /* SIOCGIWAPLIST -- depricated */ | 8051 | NULL, /* SIOCGIWAPLIST -- deprecated */ |
8060 | ipw2100_wx_set_scan, /* SIOCSIWSCAN */ | 8052 | ipw2100_wx_set_scan, /* SIOCSIWSCAN */ |
8061 | ipw2100_wx_get_scan, /* SIOCGIWSCAN */ | 8053 | ipw2100_wx_get_scan, /* SIOCGIWSCAN */ |
8062 | ipw2100_wx_set_essid, /* SIOCSIWESSID */ | 8054 | ipw2100_wx_set_essid, /* SIOCSIWESSID */ |
@@ -8431,7 +8423,7 @@ int ipw2100_get_firmware(struct ipw2100_priv *priv, struct ipw2100_fw *fw) | |||
8431 | priv->net_dev->name, fw_name); | 8423 | priv->net_dev->name, fw_name); |
8432 | return rc; | 8424 | return rc; |
8433 | } | 8425 | } |
8434 | IPW_DEBUG_INFO("firmware data %p size %d\n", fw->fw_entry->data, | 8426 | IPW_DEBUG_INFO("firmware data %p size %zd\n", fw->fw_entry->data, |
8435 | fw->fw_entry->size); | 8427 | fw->fw_entry->size); |
8436 | 8428 | ||
8437 | ipw2100_mod_firmware_load(fw); | 8429 | ipw2100_mod_firmware_load(fw); |
diff --git a/drivers/net/wireless/ipw2100.h b/drivers/net/wireless/ipw2100.h index bb31fa03f69f..95a05b554c1a 100644 --- a/drivers/net/wireless/ipw2100.h +++ b/drivers/net/wireless/ipw2100.h | |||
@@ -44,30 +44,6 @@ | |||
44 | 44 | ||
45 | #include <linux/workqueue.h> | 45 | #include <linux/workqueue.h> |
46 | 46 | ||
47 | #ifndef IRQ_NONE | ||
48 | typedef void irqreturn_t; | ||
49 | #define IRQ_NONE | ||
50 | #define IRQ_HANDLED | ||
51 | #define IRQ_RETVAL(x) | ||
52 | #endif | ||
53 | |||
54 | #if WIRELESS_EXT < 17 | ||
55 | #define IW_QUAL_QUAL_INVALID 0x10 | ||
56 | #define IW_QUAL_LEVEL_INVALID 0x20 | ||
57 | #define IW_QUAL_NOISE_INVALID 0x40 | ||
58 | #endif | ||
59 | |||
60 | #if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,5) ) | ||
61 | #define pci_dma_sync_single_for_cpu pci_dma_sync_single | ||
62 | #define pci_dma_sync_single_for_device pci_dma_sync_single | ||
63 | #endif | ||
64 | |||
65 | #ifndef HAVE_FREE_NETDEV | ||
66 | #define free_netdev(x) kfree(x) | ||
67 | #endif | ||
68 | |||
69 | |||
70 | |||
71 | struct ipw2100_priv; | 47 | struct ipw2100_priv; |
72 | struct ipw2100_tx_packet; | 48 | struct ipw2100_tx_packet; |
73 | struct ipw2100_rx_packet; | 49 | struct ipw2100_rx_packet; |
@@ -167,15 +143,6 @@ enum { IPW_DEBUG_ENABLED = 0 }; | |||
167 | #define IPW_DEBUG_STATE(f, a...) IPW_DEBUG(IPW_DL_STATE | IPW_DL_ASSOC | IPW_DL_INFO, f, ## a) | 143 | #define IPW_DEBUG_STATE(f, a...) IPW_DEBUG(IPW_DL_STATE | IPW_DL_ASSOC | IPW_DL_INFO, f, ## a) |
168 | #define IPW_DEBUG_ASSOC(f, a...) IPW_DEBUG(IPW_DL_ASSOC | IPW_DL_INFO, f, ## a) | 144 | #define IPW_DEBUG_ASSOC(f, a...) IPW_DEBUG(IPW_DL_ASSOC | IPW_DL_INFO, f, ## a) |
169 | 145 | ||
170 | |||
171 | #define VERIFY(f) \ | ||
172 | { \ | ||
173 | int status = 0; \ | ||
174 | status = f; \ | ||
175 | if(status) \ | ||
176 | return status; \ | ||
177 | } | ||
178 | |||
179 | enum { | 146 | enum { |
180 | IPW_HW_STATE_DISABLED = 1, | 147 | IPW_HW_STATE_DISABLED = 1, |
181 | IPW_HW_STATE_ENABLED = 0 | 148 | IPW_HW_STATE_ENABLED = 0 |
@@ -210,8 +177,6 @@ struct bd_status { | |||
210 | } info; | 177 | } info; |
211 | } __attribute__ ((packed)); | 178 | } __attribute__ ((packed)); |
212 | 179 | ||
213 | #define IPW_BUFDESC_LAST_FRAG 0 | ||
214 | |||
215 | struct ipw2100_bd { | 180 | struct ipw2100_bd { |
216 | u32 host_addr; | 181 | u32 host_addr; |
217 | u32 buf_length; | 182 | u32 buf_length; |
@@ -355,7 +320,7 @@ struct ipw2100_data_header { | |||
355 | u16 fragment_size; | 320 | u16 fragment_size; |
356 | } __attribute__ ((packed)); | 321 | } __attribute__ ((packed)); |
357 | 322 | ||
358 | // Host command data structure | 323 | /* Host command data structure */ |
359 | struct host_command { | 324 | struct host_command { |
360 | u32 host_command; // COMMAND ID | 325 | u32 host_command; // COMMAND ID |
361 | u32 host_command1; // COMMAND ID | 326 | u32 host_command1; // COMMAND ID |
@@ -648,9 +613,6 @@ struct ipw2100_priv { | |||
648 | struct semaphore adapter_sem; | 613 | struct semaphore adapter_sem; |
649 | 614 | ||
650 | wait_queue_head_t wait_command_queue; | 615 | wait_queue_head_t wait_command_queue; |
651 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) | ||
652 | u32 pm_state[PM_STATE_SIZE]; | ||
653 | #endif | ||
654 | }; | 616 | }; |
655 | 617 | ||
656 | 618 | ||
@@ -701,7 +663,7 @@ struct ipw2100_priv { | |||
701 | #define MSDU_TX_RATES 62 | 663 | #define MSDU_TX_RATES 62 |
702 | 664 | ||
703 | 665 | ||
704 | // Rogue AP Detection | 666 | /* Rogue AP Detection */ |
705 | #define SET_STATION_STAT_BITS 64 | 667 | #define SET_STATION_STAT_BITS 64 |
706 | #define CLEAR_STATIONS_STAT_BITS 65 | 668 | #define CLEAR_STATIONS_STAT_BITS 65 |
707 | #define LEAP_ROGUE_MODE 66 //TODO tbw replaced by CFG_LEAP_ROGUE_AP | 669 | #define LEAP_ROGUE_MODE 66 //TODO tbw replaced by CFG_LEAP_ROGUE_AP |
@@ -711,25 +673,16 @@ struct ipw2100_priv { | |||
711 | 673 | ||
712 | 674 | ||
713 | 675 | ||
714 | // system configuration bit mask: | 676 | /* system configuration bit mask: */ |
715 | //#define IPW_CFG_ANTENNA_SETTING 0x03 | ||
716 | //#define IPW_CFG_ANTENNA_A 0x01 | ||
717 | //#define IPW_CFG_ANTENNA_B 0x02 | ||
718 | #define IPW_CFG_MONITOR 0x00004 | 677 | #define IPW_CFG_MONITOR 0x00004 |
719 | //#define IPW_CFG_TX_STATUS_ENABLE 0x00008 | ||
720 | #define IPW_CFG_PREAMBLE_AUTO 0x00010 | 678 | #define IPW_CFG_PREAMBLE_AUTO 0x00010 |
721 | #define IPW_CFG_IBSS_AUTO_START 0x00020 | 679 | #define IPW_CFG_IBSS_AUTO_START 0x00020 |
722 | //#define IPW_CFG_KERBEROS_ENABLE 0x00040 | ||
723 | #define IPW_CFG_LOOPBACK 0x00100 | 680 | #define IPW_CFG_LOOPBACK 0x00100 |
724 | //#define IPW_CFG_WNMP_PING_PASS 0x00200 | ||
725 | //#define IPW_CFG_DEBUG_ENABLE 0x00400 | ||
726 | #define IPW_CFG_ANSWER_BCSSID_PROBE 0x00800 | 681 | #define IPW_CFG_ANSWER_BCSSID_PROBE 0x00800 |
727 | //#define IPW_CFG_BT_PRIORITY 0x01000 | ||
728 | #define IPW_CFG_BT_SIDEBAND_SIGNAL 0x02000 | 682 | #define IPW_CFG_BT_SIDEBAND_SIGNAL 0x02000 |
729 | #define IPW_CFG_802_1x_ENABLE 0x04000 | 683 | #define IPW_CFG_802_1x_ENABLE 0x04000 |
730 | #define IPW_CFG_BSS_MASK 0x08000 | 684 | #define IPW_CFG_BSS_MASK 0x08000 |
731 | #define IPW_CFG_IBSS_MASK 0x10000 | 685 | #define IPW_CFG_IBSS_MASK 0x10000 |
732 | //#define IPW_CFG_DYNAMIC_CW 0x10000 | ||
733 | 686 | ||
734 | #define IPW_SCAN_NOASSOCIATE (1<<0) | 687 | #define IPW_SCAN_NOASSOCIATE (1<<0) |
735 | #define IPW_SCAN_MIXED_CELL (1<<1) | 688 | #define IPW_SCAN_MIXED_CELL (1<<1) |
@@ -761,41 +714,6 @@ struct ipw2100_priv { | |||
761 | #define IPW_MEM_HOST_SHARED_TX_QUEUE_WRITE_INDEX \ | 714 | #define IPW_MEM_HOST_SHARED_TX_QUEUE_WRITE_INDEX \ |
762 | (IPW_MEM_SRAM_HOST_INTERRUPT_AREA_LOWER_BOUND) | 715 | (IPW_MEM_SRAM_HOST_INTERRUPT_AREA_LOWER_BOUND) |
763 | 716 | ||
764 | |||
765 | #if 0 | ||
766 | #define IPW_MEM_HOST_SHARED_TX_QUEUE_0_BD_BASE (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x00) | ||
767 | #define IPW_MEM_HOST_SHARED_TX_QUEUE_0_BD_SIZE (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x04) | ||
768 | #define IPW_MEM_HOST_SHARED_TX_QUEUE_1_BD_BASE (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x08) | ||
769 | #define IPW_MEM_HOST_SHARED_TX_QUEUE_1_BD_SIZE (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x0c) | ||
770 | #define IPW_MEM_HOST_SHARED_TX_QUEUE_2_BD_BASE (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x10) | ||
771 | #define IPW_MEM_HOST_SHARED_TX_QUEUE_2_BD_SIZE (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x14) | ||
772 | #define IPW_MEM_HOST_SHARED_TX_QUEUE_3_BD_BASE (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x18) | ||
773 | #define IPW_MEM_HOST_SHARED_TX_QUEUE_3_BD_SIZE (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x1c) | ||
774 | #define IPW_MEM_HOST_SHARED_TX_QUEUE_0_READ_INDEX (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x80) | ||
775 | #define IPW_MEM_HOST_SHARED_TX_QUEUE_1_READ_INDEX (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x84) | ||
776 | #define IPW_MEM_HOST_SHARED_TX_QUEUE_2_READ_INDEX (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x88) | ||
777 | #define IPW_MEM_HOST_SHARED_TX_QUEUE_3_READ_INDEX (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x8c) | ||
778 | |||
779 | #define IPW_MEM_HOST_SHARED_TX_QUEUE_BD_BASE(QueueNum) \ | ||
780 | (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + (QueueNum<<3)) | ||
781 | #define IPW_MEM_HOST_SHARED_TX_QUEUE_BD_SIZE(QueueNum) \ | ||
782 | (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x0004+(QueueNum<<3)) | ||
783 | #define IPW_MEM_HOST_SHARED_TX_QUEUE_READ_INDEX(QueueNum) \ | ||
784 | (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x0080+(QueueNum<<2)) | ||
785 | |||
786 | #define IPW_MEM_HOST_SHARED_TX_QUEUE_0_WRITE_INDEX \ | ||
787 | (IPW_MEM_SRAM_HOST_INTERRUPT_AREA_LOWER_BOUND + 0x00) | ||
788 | #define IPW_MEM_HOST_SHARED_TX_QUEUE_1_WRITE_INDEX \ | ||
789 | (IPW_MEM_SRAM_HOST_INTERRUPT_AREA_LOWER_BOUND + 0x04) | ||
790 | #define IPW_MEM_HOST_SHARED_TX_QUEUE_2_WRITE_INDEX \ | ||
791 | (IPW_MEM_SRAM_HOST_INTERRUPT_AREA_LOWER_BOUND + 0x08) | ||
792 | #define IPW_MEM_HOST_SHARED_TX_QUEUE_3_WRITE_INDEX \ | ||
793 | (IPW_MEM_SRAM_HOST_INTERRUPT_AREA_LOWER_BOUND + 0x0c) | ||
794 | #define IPW_MEM_HOST_SHARED_SLAVE_MODE_INT_REGISTER \ | ||
795 | (IPW_MEM_SRAM_HOST_INTERRUPT_AREA_LOWER_BOUND + 0x78) | ||
796 | |||
797 | #endif | ||
798 | |||
799 | #define IPW_MEM_HOST_SHARED_ORDINALS_TABLE_1 (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x180) | 717 | #define IPW_MEM_HOST_SHARED_ORDINALS_TABLE_1 (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x180) |
800 | #define IPW_MEM_HOST_SHARED_ORDINALS_TABLE_2 (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x184) | 718 | #define IPW_MEM_HOST_SHARED_ORDINALS_TABLE_2 (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x184) |
801 | 719 | ||
@@ -913,7 +831,7 @@ struct ipw2100_rx { | |||
913 | } rx_data; | 831 | } rx_data; |
914 | } __attribute__ ((packed)); | 832 | } __attribute__ ((packed)); |
915 | 833 | ||
916 | // Bit 0-7 are for 802.11b tx rates - . Bit 5-7 are reserved | 834 | /* Bit 0-7 are for 802.11b tx rates - . Bit 5-7 are reserved */ |
917 | #define TX_RATE_1_MBIT 0x0001 | 835 | #define TX_RATE_1_MBIT 0x0001 |
918 | #define TX_RATE_2_MBIT 0x0002 | 836 | #define TX_RATE_2_MBIT 0x0002 |
919 | #define TX_RATE_5_5_MBIT 0x0004 | 837 | #define TX_RATE_5_5_MBIT 0x0004 |
@@ -1193,7 +1111,6 @@ typedef enum _ORDINAL_TABLE_1 { // NS - means Not Supported by FW | |||
1193 | IPW_ORD_UCODE_VERSION, // Ucode Version | 1111 | IPW_ORD_UCODE_VERSION, // Ucode Version |
1194 | IPW_ORD_HW_RF_SWITCH_STATE = 214, // HW RF Kill Switch State | 1112 | IPW_ORD_HW_RF_SWITCH_STATE = 214, // HW RF Kill Switch State |
1195 | } ORDINALTABLE1; | 1113 | } ORDINALTABLE1; |
1196 | //ENDOF TABLE1 | ||
1197 | 1114 | ||
1198 | // ordinal table 2 | 1115 | // ordinal table 2 |
1199 | // Variable length data: | 1116 | // Variable length data: |
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index 69733465354b..16cfd907e715 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c | |||
@@ -241,8 +241,8 @@ static void _ipw_write_reg8(struct ipw_priv *priv, u32 reg, u8 value) | |||
241 | IPW_DEBUG_IO(" reg = 0x%8X : value = 0x%8X\n", reg, value); | 241 | IPW_DEBUG_IO(" reg = 0x%8X : value = 0x%8X\n", reg, value); |
242 | _ipw_write32(priv, CX2_INDIRECT_ADDR, reg & CX2_INDIRECT_ADDR_MASK); | 242 | _ipw_write32(priv, CX2_INDIRECT_ADDR, reg & CX2_INDIRECT_ADDR_MASK); |
243 | _ipw_write8(priv, CX2_INDIRECT_DATA, value); | 243 | _ipw_write8(priv, CX2_INDIRECT_DATA, value); |
244 | IPW_DEBUG_IO(" reg = 0x%8X : value = 0x%8X\n", | 244 | IPW_DEBUG_IO(" reg = 0x%8lX : value = 0x%8X\n", |
245 | (unsigned)(priv->hw_base + CX2_INDIRECT_DATA), | 245 | (unsigned long)(priv->hw_base + CX2_INDIRECT_DATA), |
246 | value); | 246 | value); |
247 | } | 247 | } |
248 | 248 | ||
@@ -508,7 +508,7 @@ static int ipw_get_ordinal(struct ipw_priv *priv, u32 ord, void *val, | |||
508 | /* verify we have enough room to store the value */ | 508 | /* verify we have enough room to store the value */ |
509 | if (*len < sizeof(u32)) { | 509 | if (*len < sizeof(u32)) { |
510 | IPW_DEBUG_ORD("ordinal buffer length too small, " | 510 | IPW_DEBUG_ORD("ordinal buffer length too small, " |
511 | "need %d\n", sizeof(u32)); | 511 | "need %zd\n", sizeof(u32)); |
512 | return -EINVAL; | 512 | return -EINVAL; |
513 | } | 513 | } |
514 | 514 | ||
@@ -541,7 +541,7 @@ static int ipw_get_ordinal(struct ipw_priv *priv, u32 ord, void *val, | |||
541 | /* verify we have enough room to store the value */ | 541 | /* verify we have enough room to store the value */ |
542 | if (*len < sizeof(u32)) { | 542 | if (*len < sizeof(u32)) { |
543 | IPW_DEBUG_ORD("ordinal buffer length too small, " | 543 | IPW_DEBUG_ORD("ordinal buffer length too small, " |
544 | "need %d\n", sizeof(u32)); | 544 | "need %zd\n", sizeof(u32)); |
545 | return -EINVAL; | 545 | return -EINVAL; |
546 | } | 546 | } |
547 | 547 | ||
@@ -642,8 +642,8 @@ static ssize_t show_debug_level(struct device_driver *d, char *buf) | |||
642 | { | 642 | { |
643 | return sprintf(buf, "0x%08X\n", ipw_debug_level); | 643 | return sprintf(buf, "0x%08X\n", ipw_debug_level); |
644 | } | 644 | } |
645 | static ssize_t store_debug_level(struct device_driver *d, const char *buf, | 645 | static ssize_t store_debug_level(struct device_driver *d, |
646 | size_t count) | 646 | const char *buf, size_t count) |
647 | { | 647 | { |
648 | char *p = (char *)buf; | 648 | char *p = (char *)buf; |
649 | u32 val; | 649 | u32 val; |
@@ -667,23 +667,26 @@ static ssize_t store_debug_level(struct device_driver *d, const char *buf, | |||
667 | static DRIVER_ATTR(debug_level, S_IWUSR | S_IRUGO, | 667 | static DRIVER_ATTR(debug_level, S_IWUSR | S_IRUGO, |
668 | show_debug_level, store_debug_level); | 668 | show_debug_level, store_debug_level); |
669 | 669 | ||
670 | static ssize_t show_status(struct device *d, char *buf) | 670 | static ssize_t show_status(struct device *d, |
671 | struct device_attribute *attr, char *buf) | ||
671 | { | 672 | { |
672 | struct ipw_priv *p = (struct ipw_priv *)d->driver_data; | 673 | struct ipw_priv *p = d->driver_data; |
673 | return sprintf(buf, "0x%08x\n", (int)p->status); | 674 | return sprintf(buf, "0x%08x\n", (int)p->status); |
674 | } | 675 | } |
675 | static DEVICE_ATTR(status, S_IRUGO, show_status, NULL); | 676 | static DEVICE_ATTR(status, S_IRUGO, show_status, NULL); |
676 | 677 | ||
677 | static ssize_t show_cfg(struct device *d, char *buf) | 678 | static ssize_t show_cfg(struct device *d, struct device_attribute *attr, |
679 | char *buf) | ||
678 | { | 680 | { |
679 | struct ipw_priv *p = (struct ipw_priv *)d->driver_data; | 681 | struct ipw_priv *p = d->driver_data; |
680 | return sprintf(buf, "0x%08x\n", (int)p->config); | 682 | return sprintf(buf, "0x%08x\n", (int)p->config); |
681 | } | 683 | } |
682 | static DEVICE_ATTR(cfg, S_IRUGO, show_cfg, NULL); | 684 | static DEVICE_ATTR(cfg, S_IRUGO, show_cfg, NULL); |
683 | 685 | ||
684 | static ssize_t show_nic_type(struct device *d, char *buf) | 686 | static ssize_t show_nic_type(struct device *d, |
687 | struct device_attribute *attr, char *buf) | ||
685 | { | 688 | { |
686 | struct ipw_priv *p = (struct ipw_priv *)d->driver_data; | 689 | struct ipw_priv *p = d->driver_data; |
687 | u8 type = p->eeprom[EEPROM_NIC_TYPE]; | 690 | u8 type = p->eeprom[EEPROM_NIC_TYPE]; |
688 | 691 | ||
689 | switch (type) { | 692 | switch (type) { |
@@ -703,8 +706,8 @@ static ssize_t show_nic_type(struct device *d, char *buf) | |||
703 | } | 706 | } |
704 | static DEVICE_ATTR(nic_type, S_IRUGO, show_nic_type, NULL); | 707 | static DEVICE_ATTR(nic_type, S_IRUGO, show_nic_type, NULL); |
705 | 708 | ||
706 | static ssize_t dump_error_log(struct device *d, const char *buf, | 709 | static ssize_t dump_error_log(struct device *d, |
707 | size_t count) | 710 | struct device_attribute *attr, const char *buf, size_t count) |
708 | { | 711 | { |
709 | char *p = (char *)buf; | 712 | char *p = (char *)buf; |
710 | 713 | ||
@@ -715,8 +718,8 @@ static ssize_t dump_error_log(struct device *d, const char *buf, | |||
715 | } | 718 | } |
716 | static DEVICE_ATTR(dump_errors, S_IWUSR, NULL, dump_error_log); | 719 | static DEVICE_ATTR(dump_errors, S_IWUSR, NULL, dump_error_log); |
717 | 720 | ||
718 | static ssize_t dump_event_log(struct device *d, const char *buf, | 721 | static ssize_t dump_event_log(struct device *d, |
719 | size_t count) | 722 | struct device_attribute *attr, const char *buf, size_t count) |
720 | { | 723 | { |
721 | char *p = (char *)buf; | 724 | char *p = (char *)buf; |
722 | 725 | ||
@@ -727,10 +730,11 @@ static ssize_t dump_event_log(struct device *d, const char *buf, | |||
727 | } | 730 | } |
728 | static DEVICE_ATTR(dump_events, S_IWUSR, NULL, dump_event_log); | 731 | static DEVICE_ATTR(dump_events, S_IWUSR, NULL, dump_event_log); |
729 | 732 | ||
730 | static ssize_t show_ucode_version(struct device *d, char *buf) | 733 | static ssize_t show_ucode_version(struct device *d, |
734 | struct device_attribute *attr, char *buf) | ||
731 | { | 735 | { |
732 | u32 len = sizeof(u32), tmp = 0; | 736 | u32 len = sizeof(u32), tmp = 0; |
733 | struct ipw_priv *p = (struct ipw_priv*)d->driver_data; | 737 | struct ipw_priv *p = d->driver_data; |
734 | 738 | ||
735 | if(ipw_get_ordinal(p, IPW_ORD_STAT_UCODE_VERSION, &tmp, &len)) | 739 | if(ipw_get_ordinal(p, IPW_ORD_STAT_UCODE_VERSION, &tmp, &len)) |
736 | return 0; | 740 | return 0; |
@@ -739,10 +743,11 @@ static ssize_t show_ucode_version(struct device *d, char *buf) | |||
739 | } | 743 | } |
740 | static DEVICE_ATTR(ucode_version, S_IWUSR|S_IRUGO, show_ucode_version, NULL); | 744 | static DEVICE_ATTR(ucode_version, S_IWUSR|S_IRUGO, show_ucode_version, NULL); |
741 | 745 | ||
742 | static ssize_t show_rtc(struct device *d, char *buf) | 746 | static ssize_t show_rtc(struct device *d, struct device_attribute *attr, |
747 | char *buf) | ||
743 | { | 748 | { |
744 | u32 len = sizeof(u32), tmp = 0; | 749 | u32 len = sizeof(u32), tmp = 0; |
745 | struct ipw_priv *p = (struct ipw_priv*)d->driver_data; | 750 | struct ipw_priv *p = d->driver_data; |
746 | 751 | ||
747 | if(ipw_get_ordinal(p, IPW_ORD_STAT_RTC, &tmp, &len)) | 752 | if(ipw_get_ordinal(p, IPW_ORD_STAT_RTC, &tmp, &len)) |
748 | return 0; | 753 | return 0; |
@@ -755,35 +760,38 @@ static DEVICE_ATTR(rtc, S_IWUSR|S_IRUGO, show_rtc, NULL); | |||
755 | * Add a device attribute to view/control the delay between eeprom | 760 | * Add a device attribute to view/control the delay between eeprom |
756 | * operations. | 761 | * operations. |
757 | */ | 762 | */ |
758 | static ssize_t show_eeprom_delay(struct device *d, char *buf) | 763 | static ssize_t show_eeprom_delay(struct device *d, |
764 | struct device_attribute *attr, char *buf) | ||
759 | { | 765 | { |
760 | int n = ((struct ipw_priv*)d->driver_data)->eeprom_delay; | 766 | int n = ((struct ipw_priv*)d->driver_data)->eeprom_delay; |
761 | return sprintf(buf, "%i\n", n); | 767 | return sprintf(buf, "%i\n", n); |
762 | } | 768 | } |
763 | static ssize_t store_eeprom_delay(struct device *d, const char *buf, | 769 | static ssize_t store_eeprom_delay(struct device *d, |
764 | size_t count) | 770 | struct device_attribute *attr, const char *buf, |
771 | size_t count) | ||
765 | { | 772 | { |
766 | struct ipw_priv *p = (struct ipw_priv*)d->driver_data; | 773 | struct ipw_priv *p = d->driver_data; |
767 | sscanf(buf, "%i", &p->eeprom_delay); | 774 | sscanf(buf, "%i", &p->eeprom_delay); |
768 | return strnlen(buf, count); | 775 | return strnlen(buf, count); |
769 | } | 776 | } |
770 | static DEVICE_ATTR(eeprom_delay, S_IWUSR|S_IRUGO, | 777 | static DEVICE_ATTR(eeprom_delay, S_IWUSR|S_IRUGO, |
771 | show_eeprom_delay,store_eeprom_delay); | 778 | show_eeprom_delay,store_eeprom_delay); |
772 | 779 | ||
773 | static ssize_t show_command_event_reg(struct device *d, char *buf) | 780 | static ssize_t show_command_event_reg(struct device *d, |
781 | struct device_attribute *attr, char *buf) | ||
774 | { | 782 | { |
775 | u32 reg = 0; | 783 | u32 reg = 0; |
776 | struct ipw_priv *p = (struct ipw_priv *)d->driver_data; | 784 | struct ipw_priv *p = d->driver_data; |
777 | 785 | ||
778 | reg = ipw_read_reg32(p, CX2_INTERNAL_CMD_EVENT); | 786 | reg = ipw_read_reg32(p, CX2_INTERNAL_CMD_EVENT); |
779 | return sprintf(buf, "0x%08x\n", reg); | 787 | return sprintf(buf, "0x%08x\n", reg); |
780 | } | 788 | } |
781 | static ssize_t store_command_event_reg(struct device *d, | 789 | static ssize_t store_command_event_reg(struct device *d, |
782 | const char *buf, | 790 | struct device_attribute *attr, const char *buf, |
783 | size_t count) | 791 | size_t count) |
784 | { | 792 | { |
785 | u32 reg; | 793 | u32 reg; |
786 | struct ipw_priv *p = (struct ipw_priv *)d->driver_data; | 794 | struct ipw_priv *p = d->driver_data; |
787 | 795 | ||
788 | sscanf(buf, "%x", ®); | 796 | sscanf(buf, "%x", ®); |
789 | ipw_write_reg32(p, CX2_INTERNAL_CMD_EVENT, reg); | 797 | ipw_write_reg32(p, CX2_INTERNAL_CMD_EVENT, reg); |
@@ -792,20 +800,21 @@ static ssize_t store_command_event_reg(struct device *d, | |||
792 | static DEVICE_ATTR(command_event_reg, S_IWUSR|S_IRUGO, | 800 | static DEVICE_ATTR(command_event_reg, S_IWUSR|S_IRUGO, |
793 | show_command_event_reg,store_command_event_reg); | 801 | show_command_event_reg,store_command_event_reg); |
794 | 802 | ||
795 | static ssize_t show_mem_gpio_reg(struct device *d, char *buf) | 803 | static ssize_t show_mem_gpio_reg(struct device *d, |
804 | struct device_attribute *attr, char *buf) | ||
796 | { | 805 | { |
797 | u32 reg = 0; | 806 | u32 reg = 0; |
798 | struct ipw_priv *p = (struct ipw_priv *)d->driver_data; | 807 | struct ipw_priv *p = d->driver_data; |
799 | 808 | ||
800 | reg = ipw_read_reg32(p, 0x301100); | 809 | reg = ipw_read_reg32(p, 0x301100); |
801 | return sprintf(buf, "0x%08x\n", reg); | 810 | return sprintf(buf, "0x%08x\n", reg); |
802 | } | 811 | } |
803 | static ssize_t store_mem_gpio_reg(struct device *d, | 812 | static ssize_t store_mem_gpio_reg(struct device *d, |
804 | const char *buf, | 813 | struct device_attribute *attr, const char *buf, |
805 | size_t count) | 814 | size_t count) |
806 | { | 815 | { |
807 | u32 reg; | 816 | u32 reg; |
808 | struct ipw_priv *p = (struct ipw_priv *)d->driver_data; | 817 | struct ipw_priv *p = d->driver_data; |
809 | 818 | ||
810 | sscanf(buf, "%x", ®); | 819 | sscanf(buf, "%x", ®); |
811 | ipw_write_reg32(p, 0x301100, reg); | 820 | ipw_write_reg32(p, 0x301100, reg); |
@@ -814,10 +823,11 @@ static ssize_t store_mem_gpio_reg(struct device *d, | |||
814 | static DEVICE_ATTR(mem_gpio_reg, S_IWUSR|S_IRUGO, | 823 | static DEVICE_ATTR(mem_gpio_reg, S_IWUSR|S_IRUGO, |
815 | show_mem_gpio_reg,store_mem_gpio_reg); | 824 | show_mem_gpio_reg,store_mem_gpio_reg); |
816 | 825 | ||
817 | static ssize_t show_indirect_dword(struct device *d, char *buf) | 826 | static ssize_t show_indirect_dword(struct device *d, |
827 | struct device_attribute *attr, char *buf) | ||
818 | { | 828 | { |
819 | u32 reg = 0; | 829 | u32 reg = 0; |
820 | struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; | 830 | struct ipw_priv *priv = d->driver_data; |
821 | if (priv->status & STATUS_INDIRECT_DWORD) | 831 | if (priv->status & STATUS_INDIRECT_DWORD) |
822 | reg = ipw_read_reg32(priv, priv->indirect_dword); | 832 | reg = ipw_read_reg32(priv, priv->indirect_dword); |
823 | else | 833 | else |
@@ -825,11 +835,11 @@ static ssize_t show_indirect_dword(struct device *d, char *buf) | |||
825 | 835 | ||
826 | return sprintf(buf, "0x%08x\n", reg); | 836 | return sprintf(buf, "0x%08x\n", reg); |
827 | } | 837 | } |
828 | static ssize_t store_indirect_dword(struct device *d, | 838 | static ssize_t store_indirect_dword(struct device *d, |
829 | const char *buf, | 839 | struct device_attribute *attr, const char *buf, |
830 | size_t count) | 840 | size_t count) |
831 | { | 841 | { |
832 | struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; | 842 | struct ipw_priv *priv = d->driver_data; |
833 | 843 | ||
834 | sscanf(buf, "%x", &priv->indirect_dword); | 844 | sscanf(buf, "%x", &priv->indirect_dword); |
835 | priv->status |= STATUS_INDIRECT_DWORD; | 845 | priv->status |= STATUS_INDIRECT_DWORD; |
@@ -838,10 +848,11 @@ static ssize_t store_indirect_dword(struct device *d, | |||
838 | static DEVICE_ATTR(indirect_dword, S_IWUSR|S_IRUGO, | 848 | static DEVICE_ATTR(indirect_dword, S_IWUSR|S_IRUGO, |
839 | show_indirect_dword,store_indirect_dword); | 849 | show_indirect_dword,store_indirect_dword); |
840 | 850 | ||
841 | static ssize_t show_indirect_byte(struct device *d, char *buf) | 851 | static ssize_t show_indirect_byte(struct device *d, |
852 | struct device_attribute *attr, char *buf) | ||
842 | { | 853 | { |
843 | u8 reg = 0; | 854 | u8 reg = 0; |
844 | struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; | 855 | struct ipw_priv *priv = d->driver_data; |
845 | if (priv->status & STATUS_INDIRECT_BYTE) | 856 | if (priv->status & STATUS_INDIRECT_BYTE) |
846 | reg = ipw_read_reg8(priv, priv->indirect_byte); | 857 | reg = ipw_read_reg8(priv, priv->indirect_byte); |
847 | else | 858 | else |
@@ -849,11 +860,11 @@ static ssize_t show_indirect_byte(struct device *d, char *buf) | |||
849 | 860 | ||
850 | return sprintf(buf, "0x%02x\n", reg); | 861 | return sprintf(buf, "0x%02x\n", reg); |
851 | } | 862 | } |
852 | static ssize_t store_indirect_byte(struct device *d, | 863 | static ssize_t store_indirect_byte(struct device *d, |
853 | const char *buf, | 864 | struct device_attribute *attr, const char *buf, |
854 | size_t count) | 865 | size_t count) |
855 | { | 866 | { |
856 | struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; | 867 | struct ipw_priv *priv = d->driver_data; |
857 | 868 | ||
858 | sscanf(buf, "%x", &priv->indirect_byte); | 869 | sscanf(buf, "%x", &priv->indirect_byte); |
859 | priv->status |= STATUS_INDIRECT_BYTE; | 870 | priv->status |= STATUS_INDIRECT_BYTE; |
@@ -862,10 +873,11 @@ static ssize_t store_indirect_byte(struct device *d, | |||
862 | static DEVICE_ATTR(indirect_byte, S_IWUSR|S_IRUGO, | 873 | static DEVICE_ATTR(indirect_byte, S_IWUSR|S_IRUGO, |
863 | show_indirect_byte, store_indirect_byte); | 874 | show_indirect_byte, store_indirect_byte); |
864 | 875 | ||
865 | static ssize_t show_direct_dword(struct device *d, char *buf) | 876 | static ssize_t show_direct_dword(struct device *d, |
877 | struct device_attribute *attr, char *buf) | ||
866 | { | 878 | { |
867 | u32 reg = 0; | 879 | u32 reg = 0; |
868 | struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; | 880 | struct ipw_priv *priv = d->driver_data; |
869 | 881 | ||
870 | if (priv->status & STATUS_DIRECT_DWORD) | 882 | if (priv->status & STATUS_DIRECT_DWORD) |
871 | reg = ipw_read32(priv, priv->direct_dword); | 883 | reg = ipw_read32(priv, priv->direct_dword); |
@@ -874,11 +886,11 @@ static ssize_t show_direct_dword(struct device *d, char *buf) | |||
874 | 886 | ||
875 | return sprintf(buf, "0x%08x\n", reg); | 887 | return sprintf(buf, "0x%08x\n", reg); |
876 | } | 888 | } |
877 | static ssize_t store_direct_dword(struct device *d, | 889 | static ssize_t store_direct_dword(struct device *d, |
878 | const char *buf, | 890 | struct device_attribute *attr, const char *buf, |
879 | size_t count) | 891 | size_t count) |
880 | { | 892 | { |
881 | struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; | 893 | struct ipw_priv *priv = d->driver_data; |
882 | 894 | ||
883 | sscanf(buf, "%x", &priv->direct_dword); | 895 | sscanf(buf, "%x", &priv->direct_dword); |
884 | priv->status |= STATUS_DIRECT_DWORD; | 896 | priv->status |= STATUS_DIRECT_DWORD; |
@@ -898,13 +910,14 @@ static inline int rf_kill_active(struct ipw_priv *priv) | |||
898 | return (priv->status & STATUS_RF_KILL_HW) ? 1 : 0; | 910 | return (priv->status & STATUS_RF_KILL_HW) ? 1 : 0; |
899 | } | 911 | } |
900 | 912 | ||
901 | static ssize_t show_rf_kill(struct device *d, char *buf) | 913 | static ssize_t show_rf_kill(struct device *d, struct device_attribute *attr, |
914 | char *buf) | ||
902 | { | 915 | { |
903 | /* 0 - RF kill not enabled | 916 | /* 0 - RF kill not enabled |
904 | 1 - SW based RF kill active (sysfs) | 917 | 1 - SW based RF kill active (sysfs) |
905 | 2 - HW based RF kill active | 918 | 2 - HW based RF kill active |
906 | 3 - Both HW and SW baed RF kill active */ | 919 | 3 - Both HW and SW baed RF kill active */ |
907 | struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; | 920 | struct ipw_priv *priv = d->driver_data; |
908 | int val = ((priv->status & STATUS_RF_KILL_SW) ? 0x1 : 0x0) | | 921 | int val = ((priv->status & STATUS_RF_KILL_SW) ? 0x1 : 0x0) | |
909 | (rf_kill_active(priv) ? 0x2 : 0x0); | 922 | (rf_kill_active(priv) ? 0x2 : 0x0); |
910 | return sprintf(buf, "%i\n", val); | 923 | return sprintf(buf, "%i\n", val); |
@@ -943,9 +956,10 @@ static int ipw_radio_kill_sw(struct ipw_priv *priv, int disable_radio) | |||
943 | return 1; | 956 | return 1; |
944 | } | 957 | } |
945 | 958 | ||
946 | static ssize_t store_rf_kill(struct device *d, const char *buf, size_t count) | 959 | static ssize_t store_rf_kill(struct device *d, struct device_attribute *attr, |
960 | const char *buf, size_t count) | ||
947 | { | 961 | { |
948 | struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; | 962 | struct ipw_priv *priv = d->driver_data; |
949 | 963 | ||
950 | ipw_radio_kill_sw(priv, buf[0] == '1'); | 964 | ipw_radio_kill_sw(priv, buf[0] == '1'); |
951 | 965 | ||
@@ -1740,7 +1754,7 @@ static int ipw_fw_dma_write_command_block(struct ipw_priv *priv, int index, stru | |||
1740 | u32 address = CX2_SHARED_SRAM_DMA_CONTROL + (sizeof(struct command_block) * index); | 1754 | u32 address = CX2_SHARED_SRAM_DMA_CONTROL + (sizeof(struct command_block) * index); |
1741 | IPW_DEBUG_FW(">> :\n"); | 1755 | IPW_DEBUG_FW(">> :\n"); |
1742 | 1756 | ||
1743 | ipw_write_indirect(priv, address, (u8*)cb, sizeof(struct command_block)); | 1757 | ipw_write_indirect(priv, address, (u8*)cb, (int)sizeof(struct command_block)); |
1744 | 1758 | ||
1745 | IPW_DEBUG_FW("<< :\n"); | 1759 | IPW_DEBUG_FW("<< :\n"); |
1746 | return 0; | 1760 | return 0; |
@@ -2342,7 +2356,7 @@ static int ipw_get_fw(struct ipw_priv *priv, | |||
2342 | return -EINVAL; | 2356 | return -EINVAL; |
2343 | } | 2357 | } |
2344 | 2358 | ||
2345 | IPW_DEBUG_INFO("Loading firmware '%s' file v%d.%d (%d bytes)\n", | 2359 | IPW_DEBUG_INFO("Loading firmware '%s' file v%d.%d (%zd bytes)\n", |
2346 | name, | 2360 | name, |
2347 | IPW_FW_MAJOR(header->version), | 2361 | IPW_FW_MAJOR(header->version), |
2348 | IPW_FW_MINOR(header->version), | 2362 | IPW_FW_MINOR(header->version), |
@@ -2697,7 +2711,7 @@ static int ipw_queue_tx_init(struct ipw_priv *priv, | |||
2697 | 2711 | ||
2698 | q->bd = pci_alloc_consistent(dev,sizeof(q->bd[0])*count, &q->q.dma_addr); | 2712 | q->bd = pci_alloc_consistent(dev,sizeof(q->bd[0])*count, &q->q.dma_addr); |
2699 | if (!q->bd) { | 2713 | if (!q->bd) { |
2700 | IPW_ERROR("pci_alloc_consistent(%d) failed\n", | 2714 | IPW_ERROR("pci_alloc_consistent(%zd) failed\n", |
2701 | sizeof(q->bd[0]) * count); | 2715 | sizeof(q->bd[0]) * count); |
2702 | kfree(q->txb); | 2716 | kfree(q->txb); |
2703 | q->txb = NULL; | 2717 | q->txb = NULL; |
@@ -3466,8 +3480,8 @@ static inline void ipw_rx_notification(struct ipw_priv* priv, | |||
3466 | x->channel_num); | 3480 | x->channel_num); |
3467 | } else { | 3481 | } else { |
3468 | IPW_DEBUG_SCAN("Scan result of wrong size %d " | 3482 | IPW_DEBUG_SCAN("Scan result of wrong size %d " |
3469 | "(should be %d)\n", | 3483 | "(should be %zd)\n", |
3470 | notif->size,sizeof(*x)); | 3484 | notif->size, sizeof(*x)); |
3471 | } | 3485 | } |
3472 | break; | 3486 | break; |
3473 | } | 3487 | } |
@@ -3482,8 +3496,8 @@ static inline void ipw_rx_notification(struct ipw_priv* priv, | |||
3482 | x->status); | 3496 | x->status); |
3483 | } else { | 3497 | } else { |
3484 | IPW_ERROR("Scan completed of wrong size %d " | 3498 | IPW_ERROR("Scan completed of wrong size %d " |
3485 | "(should be %d)\n", | 3499 | "(should be %zd)\n", |
3486 | notif->size,sizeof(*x)); | 3500 | notif->size, sizeof(*x)); |
3487 | } | 3501 | } |
3488 | 3502 | ||
3489 | priv->status &= ~(STATUS_SCANNING | STATUS_SCAN_ABORTING); | 3503 | priv->status &= ~(STATUS_SCANNING | STATUS_SCAN_ABORTING); |
@@ -3515,7 +3529,7 @@ static inline void ipw_rx_notification(struct ipw_priv* priv, | |||
3515 | IPW_ERROR("Frag length: %d\n", x->frag_length); | 3529 | IPW_ERROR("Frag length: %d\n", x->frag_length); |
3516 | } else { | 3530 | } else { |
3517 | IPW_ERROR("Frag length of wrong size %d " | 3531 | IPW_ERROR("Frag length of wrong size %d " |
3518 | "(should be %d)\n", | 3532 | "(should be %zd)\n", |
3519 | notif->size, sizeof(*x)); | 3533 | notif->size, sizeof(*x)); |
3520 | } | 3534 | } |
3521 | break; | 3535 | break; |
@@ -3532,8 +3546,8 @@ static inline void ipw_rx_notification(struct ipw_priv* priv, | |||
3532 | memcpy(&priv->last_link_deterioration, x, sizeof(*x)); | 3546 | memcpy(&priv->last_link_deterioration, x, sizeof(*x)); |
3533 | } else { | 3547 | } else { |
3534 | IPW_ERROR("Link Deterioration of wrong size %d " | 3548 | IPW_ERROR("Link Deterioration of wrong size %d " |
3535 | "(should be %d)\n", | 3549 | "(should be %zd)\n", |
3536 | notif->size,sizeof(*x)); | 3550 | notif->size, sizeof(*x)); |
3537 | } | 3551 | } |
3538 | break; | 3552 | break; |
3539 | } | 3553 | } |
@@ -3552,7 +3566,7 @@ static inline void ipw_rx_notification(struct ipw_priv* priv, | |||
3552 | struct notif_beacon_state *x = ¬if->u.beacon_state; | 3566 | struct notif_beacon_state *x = ¬if->u.beacon_state; |
3553 | if (notif->size != sizeof(*x)) { | 3567 | if (notif->size != sizeof(*x)) { |
3554 | IPW_ERROR("Beacon state of wrong size %d (should " | 3568 | IPW_ERROR("Beacon state of wrong size %d (should " |
3555 | "be %d)\n", notif->size, sizeof(*x)); | 3569 | "be %zd)\n", notif->size, sizeof(*x)); |
3556 | break; | 3570 | break; |
3557 | } | 3571 | } |
3558 | 3572 | ||
@@ -3602,8 +3616,8 @@ static inline void ipw_rx_notification(struct ipw_priv* priv, | |||
3602 | break; | 3616 | break; |
3603 | } | 3617 | } |
3604 | 3618 | ||
3605 | IPW_ERROR("TGi Tx Key of wrong size %d (should be %d)\n", | 3619 | IPW_ERROR("TGi Tx Key of wrong size %d (should be %zd)\n", |
3606 | notif->size,sizeof(*x)); | 3620 | notif->size, sizeof(*x)); |
3607 | break; | 3621 | break; |
3608 | } | 3622 | } |
3609 | 3623 | ||
@@ -3616,8 +3630,8 @@ static inline void ipw_rx_notification(struct ipw_priv* priv, | |||
3616 | break; | 3630 | break; |
3617 | } | 3631 | } |
3618 | 3632 | ||
3619 | IPW_ERROR("Calibration of wrong size %d (should be %d)\n", | 3633 | IPW_ERROR("Calibration of wrong size %d (should be %zd)\n", |
3620 | notif->size,sizeof(*x)); | 3634 | notif->size, sizeof(*x)); |
3621 | break; | 3635 | break; |
3622 | } | 3636 | } |
3623 | 3637 | ||
@@ -3628,7 +3642,7 @@ static inline void ipw_rx_notification(struct ipw_priv* priv, | |||
3628 | break; | 3642 | break; |
3629 | } | 3643 | } |
3630 | 3644 | ||
3631 | IPW_ERROR("Noise stat is wrong size %d (should be %d)\n", | 3645 | IPW_ERROR("Noise stat is wrong size %d (should be %zd)\n", |
3632 | notif->size, sizeof(u32)); | 3646 | notif->size, sizeof(u32)); |
3633 | break; | 3647 | break; |
3634 | } | 3648 | } |
@@ -4823,7 +4837,7 @@ static inline void ipw_handle_data_packet(struct ipw_priv *priv, | |||
4823 | } | 4837 | } |
4824 | 4838 | ||
4825 | /* Advance skb->data to the start of the actual payload */ | 4839 | /* Advance skb->data to the start of the actual payload */ |
4826 | skb_reserve(rxb->skb, (u32)&pkt->u.frame.data[0] - (u32)pkt); | 4840 | skb_reserve(rxb->skb, offsetof(struct ipw_rx_packet, u.frame.data)); |
4827 | 4841 | ||
4828 | /* Set the size of the skb to the size of the frame */ | 4842 | /* Set the size of the skb to the size of the frame */ |
4829 | skb_put(rxb->skb, pkt->u.frame.length); | 4843 | skb_put(rxb->skb, pkt->u.frame.length); |
@@ -6979,10 +6993,9 @@ static int ipw_pci_probe(struct pci_dev *pdev, | |||
6979 | 6993 | ||
6980 | pci_set_master(pdev); | 6994 | pci_set_master(pdev); |
6981 | 6995 | ||
6982 | #define PCI_DMA_32BIT 0x00000000ffffffffULL | 6996 | err = pci_set_dma_mask(pdev, DMA_32BIT_MASK); |
6983 | err = pci_set_dma_mask(pdev, PCI_DMA_32BIT); | ||
6984 | if (!err) | 6997 | if (!err) |
6985 | err = pci_set_consistent_dma_mask(pdev, PCI_DMA_32BIT); | 6998 | err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); |
6986 | if (err) { | 6999 | if (err) { |
6987 | printk(KERN_WARNING DRV_NAME ": No suitable DMA available.\n"); | 7000 | printk(KERN_WARNING DRV_NAME ": No suitable DMA available.\n"); |
6988 | goto out_pci_disable_device; | 7001 | goto out_pci_disable_device; |
diff --git a/net/ieee80211/ieee80211_module.c b/net/ieee80211/ieee80211_module.c index 90bc50b97ea7..e0802b8755a0 100644 --- a/net/ieee80211/ieee80211_module.c +++ b/net/ieee80211/ieee80211_module.c | |||
@@ -40,7 +40,6 @@ | |||
40 | #include <linux/kernel.h> | 40 | #include <linux/kernel.h> |
41 | #include <linux/module.h> | 41 | #include <linux/module.h> |
42 | #include <linux/netdevice.h> | 42 | #include <linux/netdevice.h> |
43 | #include <linux/pci.h> | ||
44 | #include <linux/proc_fs.h> | 43 | #include <linux/proc_fs.h> |
45 | #include <linux/skbuff.h> | 44 | #include <linux/skbuff.h> |
46 | #include <linux/slab.h> | 45 | #include <linux/slab.h> |
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c index 2ae6ab8914b0..0dd102993ef4 100644 --- a/net/ieee80211/ieee80211_rx.c +++ b/net/ieee80211/ieee80211_rx.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
24 | #include <linux/module.h> | 24 | #include <linux/module.h> |
25 | #include <linux/netdevice.h> | 25 | #include <linux/netdevice.h> |
26 | #include <linux/pci.h> | ||
27 | #include <linux/proc_fs.h> | 26 | #include <linux/proc_fs.h> |
28 | #include <linux/skbuff.h> | 27 | #include <linux/skbuff.h> |
29 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
diff --git a/net/ieee80211/ieee80211_tx.c b/net/ieee80211/ieee80211_tx.c index a3054c5c0c05..d1049edcd14d 100644 --- a/net/ieee80211/ieee80211_tx.c +++ b/net/ieee80211/ieee80211_tx.c | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <linux/kernel.h> | 33 | #include <linux/kernel.h> |
34 | #include <linux/module.h> | 34 | #include <linux/module.h> |
35 | #include <linux/netdevice.h> | 35 | #include <linux/netdevice.h> |
36 | #include <linux/pci.h> | ||
37 | #include <linux/proc_fs.h> | 36 | #include <linux/proc_fs.h> |
38 | #include <linux/skbuff.h> | 37 | #include <linux/skbuff.h> |
39 | #include <linux/slab.h> | 38 | #include <linux/slab.h> |