From e19b813e0c9c5995423dc95b01379c89f188ae70 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Fri, 3 Jun 2005 18:29:20 +0200 Subject: [PATCH] ieee80211: fix recursive ipw2200 dependencies This results in recursive dependencies: - IPW2200 depends on NET_RADIO - IPW2200 selects IEEE80211 - IEEE80211 selects NET_RADIO This patch fixes the IPW2200 dependencies in a way that they are similar to the IPW2100 dependencies. Signed-off-by: Adrian Bunk Signed-off-by: Jiri Benc --- drivers/net/wireless/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig index 3c81e0f2b05..d20e0da05a2 100644 --- a/drivers/net/wireless/Kconfig +++ b/drivers/net/wireless/Kconfig @@ -192,9 +192,8 @@ config IPW_DEBUG config IPW2200 tristate "Intel PRO/Wireless 2200BG and 2915ABG Network Connection" - depends on NET_RADIO && PCI + depends on IEEE80211 && PCI select FW_LOADER - select IEEE80211 ---help--- A driver for the Intel PRO/Wireless 2200BG and 2915ABG Network Connection adapters. -- cgit v1.2.3 From aaa4d308a8cbc4ccfd870ee556def2e481557274 Mon Sep 17 00:00:00 2001 From: Jiri Benc Date: Tue, 7 Jun 2005 14:58:41 +0200 Subject: [PATCH] ieee80211: fix ipw 64bit compilation warnings On Mon, 06 Jun 2005 14:29:52 +0800, Zhu Yi wrote: > ("%zd", sizeof()) should be better. Thanks. This is a corrected version of the patch. This patch fixes warnings when compiling ipw2100 and ipw2200 on x86_64. Signed-off-by: Jiri Benc Signed-off-by: Jirka Bohac --- drivers/net/wireless/ipw2100.c | 24 ++++++++++++------------ drivers/net/wireless/ipw2200.c | 42 +++++++++++++++++++++--------------------- 2 files changed, 33 insertions(+), 33 deletions(-) (limited to 'drivers') diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index d296d464946..9360763735f 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c @@ -493,7 +493,7 @@ int ipw2100_get_ordinal(struct ipw2100_priv *priv, u32 ord, *len = IPW_ORD_TAB_1_ENTRY_SIZE; IPW_DEBUG_WARNING(DRV_NAME - ": ordinal buffer length too small, need %d\n", + ": ordinal buffer length too small, need %zd\n", IPW_ORD_TAB_1_ENTRY_SIZE); return -EINVAL; @@ -2302,7 +2302,7 @@ static inline void ipw2100_corruption_detected(struct ipw2100_priv *priv, #endif IPW_DEBUG_INFO(DRV_NAME ": PCI latency error detected at " - "0x%04X.\n", i * sizeof(struct ipw2100_status)); + "0x%04zX.\n", i * sizeof(struct ipw2100_status)); #ifdef ACPI_CSTATE_LIMIT_DEFINED IPW_DEBUG_INFO(DRV_NAME ": Disabling C3 transitions.\n"); @@ -2398,7 +2398,7 @@ static inline void isr_rx(struct ipw2100_priv *priv, int i, /* Make a copy of the frame so we can dump it to the logs if * ieee80211_rx fails */ memcpy(packet_data, packet->skb->data, - min(status->frame_size, IPW_RX_NIC_BUFFER_LENGTH)); + min_t(u32, status->frame_size, IPW_RX_NIC_BUFFER_LENGTH)); #endif if (!ieee80211_rx(priv->ieee, packet->skb, stats)) { @@ -2730,21 +2730,21 @@ static inline int __ipw2100_tx_process(struct ipw2100_priv *priv) { int i = txq->oldest; IPW_DEBUG_TX( - "TX%d V=%p P=%p T=%p L=%d\n", i, + "TX%d V=%p P=%04X T=%04X L=%d\n", i, &txq->drv[i], - (void*)txq->nic + i * sizeof(struct ipw2100_bd), - (void*)txq->drv[i].host_addr, + (u32)(txq->nic + i * sizeof(struct ipw2100_bd)), + txq->drv[i].host_addr, txq->drv[i].buf_length); if (packet->type == DATA) { i = (i + 1) % txq->entries; IPW_DEBUG_TX( - "TX%d V=%p P=%p T=%p L=%d\n", i, + "TX%d V=%p P=%04X T=%04X L=%d\n", i, &txq->drv[i], - (void*)txq->nic + i * - sizeof(struct ipw2100_bd), - (void*)txq->drv[i].host_addr, + (u32)(txq->nic + i * + sizeof(struct ipw2100_bd)), + (u32)txq->drv[i].host_addr, txq->drv[i].buf_length); } } @@ -4212,7 +4212,7 @@ static void bd_queue_initialize( { IPW_DEBUG_INFO("enter\n"); - IPW_DEBUG_INFO("initializing bd queue at virt=%p, phys=%08x\n", q->drv, q->nic); + IPW_DEBUG_INFO("initializing bd queue at virt=%p, phys=%08x\n", q->drv, (u32)q->nic); write_register(priv->net_dev, base, q->nic); write_register(priv->net_dev, size, q->entries); @@ -8431,7 +8431,7 @@ int ipw2100_get_firmware(struct ipw2100_priv *priv, struct ipw2100_fw *fw) priv->net_dev->name, fw_name); return rc; } - IPW_DEBUG_INFO("firmware data %p size %d\n", fw->fw_entry->data, + IPW_DEBUG_INFO("firmware data %p size %zd\n", fw->fw_entry->data, fw->fw_entry->size); ipw2100_mod_firmware_load(fw); diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index 69733465354..e256d3181cf 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) IPW_DEBUG_IO(" reg = 0x%8X : value = 0x%8X\n", reg, value); _ipw_write32(priv, CX2_INDIRECT_ADDR, reg & CX2_INDIRECT_ADDR_MASK); _ipw_write8(priv, CX2_INDIRECT_DATA, value); - IPW_DEBUG_IO(" reg = 0x%8X : value = 0x%8X\n", - (unsigned)(priv->hw_base + CX2_INDIRECT_DATA), + IPW_DEBUG_IO(" reg = 0x%8lX : value = 0x%8X\n", + (unsigned long)(priv->hw_base + CX2_INDIRECT_DATA), value); } @@ -508,7 +508,7 @@ static int ipw_get_ordinal(struct ipw_priv *priv, u32 ord, void *val, /* verify we have enough room to store the value */ if (*len < sizeof(u32)) { IPW_DEBUG_ORD("ordinal buffer length too small, " - "need %d\n", sizeof(u32)); + "need %zd\n", sizeof(u32)); return -EINVAL; } @@ -541,7 +541,7 @@ static int ipw_get_ordinal(struct ipw_priv *priv, u32 ord, void *val, /* verify we have enough room to store the value */ if (*len < sizeof(u32)) { IPW_DEBUG_ORD("ordinal buffer length too small, " - "need %d\n", sizeof(u32)); + "need %zd\n", sizeof(u32)); return -EINVAL; } @@ -1740,7 +1740,7 @@ static int ipw_fw_dma_write_command_block(struct ipw_priv *priv, int index, stru u32 address = CX2_SHARED_SRAM_DMA_CONTROL + (sizeof(struct command_block) * index); IPW_DEBUG_FW(">> :\n"); - ipw_write_indirect(priv, address, (u8*)cb, sizeof(struct command_block)); + ipw_write_indirect(priv, address, (u8*)cb, (int)sizeof(struct command_block)); IPW_DEBUG_FW("<< :\n"); return 0; @@ -2342,7 +2342,7 @@ static int ipw_get_fw(struct ipw_priv *priv, return -EINVAL; } - IPW_DEBUG_INFO("Loading firmware '%s' file v%d.%d (%d bytes)\n", + IPW_DEBUG_INFO("Loading firmware '%s' file v%d.%d (%zd bytes)\n", name, IPW_FW_MAJOR(header->version), IPW_FW_MINOR(header->version), @@ -2697,7 +2697,7 @@ static int ipw_queue_tx_init(struct ipw_priv *priv, q->bd = pci_alloc_consistent(dev,sizeof(q->bd[0])*count, &q->q.dma_addr); if (!q->bd) { - IPW_ERROR("pci_alloc_consistent(%d) failed\n", + IPW_ERROR("pci_alloc_consistent(%zd) failed\n", sizeof(q->bd[0]) * count); kfree(q->txb); q->txb = NULL; @@ -3466,8 +3466,8 @@ static inline void ipw_rx_notification(struct ipw_priv* priv, x->channel_num); } else { IPW_DEBUG_SCAN("Scan result of wrong size %d " - "(should be %d)\n", - notif->size,sizeof(*x)); + "(should be %zd)\n", + notif->size, sizeof(*x)); } break; } @@ -3482,8 +3482,8 @@ static inline void ipw_rx_notification(struct ipw_priv* priv, x->status); } else { IPW_ERROR("Scan completed of wrong size %d " - "(should be %d)\n", - notif->size,sizeof(*x)); + "(should be %zd)\n", + notif->size, sizeof(*x)); } priv->status &= ~(STATUS_SCANNING | STATUS_SCAN_ABORTING); @@ -3515,7 +3515,7 @@ static inline void ipw_rx_notification(struct ipw_priv* priv, IPW_ERROR("Frag length: %d\n", x->frag_length); } else { IPW_ERROR("Frag length of wrong size %d " - "(should be %d)\n", + "(should be %zd)\n", notif->size, sizeof(*x)); } break; @@ -3532,8 +3532,8 @@ static inline void ipw_rx_notification(struct ipw_priv* priv, memcpy(&priv->last_link_deterioration, x, sizeof(*x)); } else { IPW_ERROR("Link Deterioration of wrong size %d " - "(should be %d)\n", - notif->size,sizeof(*x)); + "(should be %zd)\n", + notif->size, sizeof(*x)); } break; } @@ -3552,7 +3552,7 @@ static inline void ipw_rx_notification(struct ipw_priv* priv, struct notif_beacon_state *x = ¬if->u.beacon_state; if (notif->size != sizeof(*x)) { IPW_ERROR("Beacon state of wrong size %d (should " - "be %d)\n", notif->size, sizeof(*x)); + "be %zd)\n", notif->size, sizeof(*x)); break; } @@ -3602,8 +3602,8 @@ static inline void ipw_rx_notification(struct ipw_priv* priv, break; } - IPW_ERROR("TGi Tx Key of wrong size %d (should be %d)\n", - notif->size,sizeof(*x)); + IPW_ERROR("TGi Tx Key of wrong size %d (should be %zd)\n", + notif->size, sizeof(*x)); break; } @@ -3616,8 +3616,8 @@ static inline void ipw_rx_notification(struct ipw_priv* priv, break; } - IPW_ERROR("Calibration of wrong size %d (should be %d)\n", - notif->size,sizeof(*x)); + IPW_ERROR("Calibration of wrong size %d (should be %zd)\n", + notif->size, sizeof(*x)); break; } @@ -3628,7 +3628,7 @@ static inline void ipw_rx_notification(struct ipw_priv* priv, break; } - IPW_ERROR("Noise stat is wrong size %d (should be %d)\n", + IPW_ERROR("Noise stat is wrong size %d (should be %zd)\n", notif->size, sizeof(u32)); break; } @@ -4823,7 +4823,7 @@ static inline void ipw_handle_data_packet(struct ipw_priv *priv, } /* Advance skb->data to the start of the actual payload */ - skb_reserve(rxb->skb, (u32)&pkt->u.frame.data[0] - (u32)pkt); + skb_reserve(rxb->skb, offsetof(struct ipw_rx_packet, u.frame.data)); /* Set the size of the skb to the size of the frame */ skb_put(rxb->skb, pkt->u.frame.length); -- cgit v1.2.3 From 070d01651296d3c87bca94f3b1313447e9e06c2f Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Mon, 20 Jun 2005 13:33:07 +0200 Subject: [PATCH] ipw2100: remove commented-out code This removes up various code/defines that was just commented out instead of being deleted. --- drivers/net/wireless/ipw2100.c | 2 -- drivers/net/wireless/ipw2100.h | 18 ++++-------------- 2 files changed, 4 insertions(+), 16 deletions(-) (limited to 'drivers') diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index 9360763735f..69d7787b44b 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c @@ -915,12 +915,10 @@ static int sw_reset_and_clock(struct ipw2100_priv *priv) if (i == 10000) return -EIO; /* TODO: better error value */ -//#if CONFIG_IPW2100_D0ENABLED /* set D0 standby bit */ read_register(priv->net_dev, IPW_REG_GP_CNTRL, &r); write_register(priv->net_dev, IPW_REG_GP_CNTRL, r | IPW_AUX_HOST_GP_CNTRL_BIT_HOST_ALLOWS_STANDBY); -//#endif return 0; } diff --git a/drivers/net/wireless/ipw2100.h b/drivers/net/wireless/ipw2100.h index bb31fa03f69..40a1373defa 100644 --- a/drivers/net/wireless/ipw2100.h +++ b/drivers/net/wireless/ipw2100.h @@ -355,7 +355,7 @@ struct ipw2100_data_header { u16 fragment_size; } __attribute__ ((packed)); -// Host command data structure +/* Host command data structure */ struct host_command { u32 host_command; // COMMAND ID u32 host_command1; // COMMAND ID @@ -701,7 +701,7 @@ struct ipw2100_priv { #define MSDU_TX_RATES 62 -// Rogue AP Detection +/* Rogue AP Detection */ #define SET_STATION_STAT_BITS 64 #define CLEAR_STATIONS_STAT_BITS 65 #define LEAP_ROGUE_MODE 66 //TODO tbw replaced by CFG_LEAP_ROGUE_AP @@ -711,25 +711,16 @@ struct ipw2100_priv { -// system configuration bit mask: -//#define IPW_CFG_ANTENNA_SETTING 0x03 -//#define IPW_CFG_ANTENNA_A 0x01 -//#define IPW_CFG_ANTENNA_B 0x02 +/* system configuration bit mask: */ #define IPW_CFG_MONITOR 0x00004 -//#define IPW_CFG_TX_STATUS_ENABLE 0x00008 #define IPW_CFG_PREAMBLE_AUTO 0x00010 #define IPW_CFG_IBSS_AUTO_START 0x00020 -//#define IPW_CFG_KERBEROS_ENABLE 0x00040 #define IPW_CFG_LOOPBACK 0x00100 -//#define IPW_CFG_WNMP_PING_PASS 0x00200 -//#define IPW_CFG_DEBUG_ENABLE 0x00400 #define IPW_CFG_ANSWER_BCSSID_PROBE 0x00800 -//#define IPW_CFG_BT_PRIORITY 0x01000 #define IPW_CFG_BT_SIDEBAND_SIGNAL 0x02000 #define IPW_CFG_802_1x_ENABLE 0x04000 #define IPW_CFG_BSS_MASK 0x08000 #define IPW_CFG_IBSS_MASK 0x10000 -//#define IPW_CFG_DYNAMIC_CW 0x10000 #define IPW_SCAN_NOASSOCIATE (1<<0) #define IPW_SCAN_MIXED_CELL (1<<1) @@ -913,7 +904,7 @@ struct ipw2100_rx { } rx_data; } __attribute__ ((packed)); -// Bit 0-7 are for 802.11b tx rates - . Bit 5-7 are reserved +/* Bit 0-7 are for 802.11b tx rates - . Bit 5-7 are reserved */ #define TX_RATE_1_MBIT 0x0001 #define TX_RATE_2_MBIT 0x0002 #define TX_RATE_5_5_MBIT 0x0004 @@ -1193,7 +1184,6 @@ typedef enum _ORDINAL_TABLE_1 { // NS - means Not Supported by FW IPW_ORD_UCODE_VERSION, // Ucode Version IPW_ORD_HW_RF_SWITCH_STATE = 214, // HW RF Kill Switch State } ORDINALTABLE1; -//ENDOF TABLE1 // ordinal table 2 // Variable length data: -- cgit v1.2.3 From 05743d165be9f0293b4ff67f4e1cf3724eb13e1f Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 20 Jun 2005 14:28:40 -0700 Subject: [PATCH] drivers/net/wireless/ipw2100: Use the DMA_32BIT_MASK constant Use the DMA_32BIT_MASK constant from dma-mapping.h when calling pci_set_dma_mask() or pci_set_consistent_dma_mask() instead of custom macros. This patch includes dma-mapping.h explicitly because it caused errors on some architectures otherwise. See http://marc.theaimsgroup.com/?t=108001993000001&r=1&w=2 for details Signed-off-by: Tobias Klauser Cc: Jeff Garzik Signed-off-by: Andrew Morton --- drivers/net/wireless/ipw2100.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index 69d7787b44b..2f2ae177780 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. #include #include #include +#include #include #include #include @@ -6423,10 +6424,6 @@ static struct net_device *ipw2100_alloc_device( return dev; } - - -#define PCI_DMA_32BIT 0x00000000ffffffffULL - static int ipw2100_pci_init_one(struct pci_dev *pci_dev, const struct pci_device_id *ent) { @@ -6480,7 +6477,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev, pci_set_master(pci_dev); pci_set_drvdata(pci_dev, priv); - err = pci_set_dma_mask(pci_dev, PCI_DMA_32BIT); + err = pci_set_dma_mask(pci_dev, DMA_32BIT_MASK); if (err) { printk(KERN_WARNING DRV_NAME "Error calling pci_set_dma_mask.\n"); -- cgit v1.2.3 From 0e08b44eedacb7824c88678d9a9ea7db25b5401c Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 20 Jun 2005 14:28:41 -0700 Subject: [PATCH] drivers/net/wireless/ipw2200: Use the DMA_32BIT_MASK constant Use the DMA_32BIT_MASK constant from dma-mapping.h when calling pci_set_dma_mask() or pci_set_consistent_dma_mask() instead of custom macros. This patch includes dma-mapping.h explicitly because it caused errors on some architectures otherwise. See http://marc.theaimsgroup.com/?t=108001993000001&r=1&w=2 for details Signed-off-by: Tobias Klauser Cc: Jeff Garzik Signed-off-by: Andrew Morton --- drivers/net/wireless/ipw2200.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index e256d3181cf..343838a5327 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c @@ -6979,10 +6979,9 @@ static int ipw_pci_probe(struct pci_dev *pdev, pci_set_master(pdev); -#define PCI_DMA_32BIT 0x00000000ffffffffULL - err = pci_set_dma_mask(pdev, PCI_DMA_32BIT); + err = pci_set_dma_mask(pdev, DMA_32BIT_MASK); if (!err) - err = pci_set_consistent_dma_mask(pdev, PCI_DMA_32BIT); + err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); if (err) { printk(KERN_WARNING DRV_NAME ": No suitable DMA available.\n"); goto out_pci_disable_device; -- cgit v1.2.3 From 4663663f1d91aa0b84526841e47f401598bfa2f4 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Mon, 20 Jun 2005 14:28:42 -0700 Subject: [PATCH] ipw2100: assume recent kernel ipw2100 still has support for old kernels. Thats considered bad for patch in mainline... this fixes few instances. Signed-off-by: Pavel Machek Signed-off-by: Andrew Morton --- drivers/net/wireless/ipw2100.c | 16 ---------------- drivers/net/wireless/ipw2100.h | 24 ------------------------ 2 files changed, 40 deletions(-) (limited to 'drivers') diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index 2f2ae177780..d2b70f6e99d 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c @@ -6702,17 +6702,9 @@ static int ipw2100_suspend(struct pci_dev *pci_dev, pm_message_t state) /* Remove the PRESENT state of the device */ netif_device_detach(dev); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) - pci_save_state(pci_dev, priv->pm_state); -#else pci_save_state(pci_dev); -#endif pci_disable_device (pci_dev); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11) - pci_set_power_state(pci_dev, state); -#else pci_set_power_state(pci_dev, PCI_D3hot); -#endif up(&priv->action_sem); @@ -6733,17 +6725,9 @@ static int ipw2100_resume(struct pci_dev *pci_dev) IPW_DEBUG_INFO("%s: Coming out of suspend...\n", dev->name); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11) - pci_set_power_state(pci_dev, 0); -#else pci_set_power_state(pci_dev, PCI_D0); -#endif pci_enable_device(pci_dev); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) - pci_restore_state(pci_dev, priv->pm_state); -#else pci_restore_state(pci_dev); -#endif /* * Suspend/Resume resets the PCI configuration space, so we have to diff --git a/drivers/net/wireless/ipw2100.h b/drivers/net/wireless/ipw2100.h index 40a1373defa..2980900beb5 100644 --- a/drivers/net/wireless/ipw2100.h +++ b/drivers/net/wireless/ipw2100.h @@ -44,30 +44,6 @@ #include -#ifndef IRQ_NONE -typedef void irqreturn_t; -#define IRQ_NONE -#define IRQ_HANDLED -#define IRQ_RETVAL(x) -#endif - -#if WIRELESS_EXT < 17 -#define IW_QUAL_QUAL_INVALID 0x10 -#define IW_QUAL_LEVEL_INVALID 0x20 -#define IW_QUAL_NOISE_INVALID 0x40 -#endif - -#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,5) ) -#define pci_dma_sync_single_for_cpu pci_dma_sync_single -#define pci_dma_sync_single_for_device pci_dma_sync_single -#endif - -#ifndef HAVE_FREE_NETDEV -#define free_netdev(x) kfree(x) -#endif - - - struct ipw2100_priv; struct ipw2100_tx_packet; struct ipw2100_rx_packet; -- cgit v1.2.3 From 5dc54a65b6981d327a84c7651bbfeef0c0aff977 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Mon, 20 Jun 2005 14:28:43 -0700 Subject: [PATCH] ipw2100: kill dead macros There are several never used macros in ipw2100. This removes them. Signed-off-by: Pavel Machek Signed-off-by: Andrew Morton --- drivers/net/wireless/ipw2100.c | 1 - drivers/net/wireless/ipw2100.h | 49 ------------------------------------------ 2 files changed, 50 deletions(-) (limited to 'drivers') diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index d2b70f6e99d..832b736e181 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c @@ -1116,7 +1116,6 @@ static inline int rf_kill_active(struct ipw2100_priv *priv) { #define MAX_RF_KILL_CHECKS 5 #define RF_KILL_CHECK_DELAY 40 -#define RF_KILL_CHECK_THRESHOLD 3 unsigned short value = 0; u32 reg = 0; diff --git a/drivers/net/wireless/ipw2100.h b/drivers/net/wireless/ipw2100.h index 2980900beb5..95a05b554c1 100644 --- a/drivers/net/wireless/ipw2100.h +++ b/drivers/net/wireless/ipw2100.h @@ -143,15 +143,6 @@ enum { IPW_DEBUG_ENABLED = 0 }; #define IPW_DEBUG_STATE(f, a...) IPW_DEBUG(IPW_DL_STATE | IPW_DL_ASSOC | IPW_DL_INFO, f, ## a) #define IPW_DEBUG_ASSOC(f, a...) IPW_DEBUG(IPW_DL_ASSOC | IPW_DL_INFO, f, ## a) - -#define VERIFY(f) \ -{ \ - int status = 0; \ - status = f; \ - if(status) \ - return status; \ -} - enum { IPW_HW_STATE_DISABLED = 1, IPW_HW_STATE_ENABLED = 0 @@ -186,8 +177,6 @@ struct bd_status { } info; } __attribute__ ((packed)); -#define IPW_BUFDESC_LAST_FRAG 0 - struct ipw2100_bd { u32 host_addr; u32 buf_length; @@ -624,9 +613,6 @@ struct ipw2100_priv { struct semaphore adapter_sem; wait_queue_head_t wait_command_queue; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) - u32 pm_state[PM_STATE_SIZE]; -#endif }; @@ -728,41 +714,6 @@ struct ipw2100_priv { #define IPW_MEM_HOST_SHARED_TX_QUEUE_WRITE_INDEX \ (IPW_MEM_SRAM_HOST_INTERRUPT_AREA_LOWER_BOUND) - -#if 0 -#define IPW_MEM_HOST_SHARED_TX_QUEUE_0_BD_BASE (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x00) -#define IPW_MEM_HOST_SHARED_TX_QUEUE_0_BD_SIZE (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x04) -#define IPW_MEM_HOST_SHARED_TX_QUEUE_1_BD_BASE (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x08) -#define IPW_MEM_HOST_SHARED_TX_QUEUE_1_BD_SIZE (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x0c) -#define IPW_MEM_HOST_SHARED_TX_QUEUE_2_BD_BASE (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x10) -#define IPW_MEM_HOST_SHARED_TX_QUEUE_2_BD_SIZE (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x14) -#define IPW_MEM_HOST_SHARED_TX_QUEUE_3_BD_BASE (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x18) -#define IPW_MEM_HOST_SHARED_TX_QUEUE_3_BD_SIZE (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x1c) -#define IPW_MEM_HOST_SHARED_TX_QUEUE_0_READ_INDEX (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x80) -#define IPW_MEM_HOST_SHARED_TX_QUEUE_1_READ_INDEX (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x84) -#define IPW_MEM_HOST_SHARED_TX_QUEUE_2_READ_INDEX (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x88) -#define IPW_MEM_HOST_SHARED_TX_QUEUE_3_READ_INDEX (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x8c) - -#define IPW_MEM_HOST_SHARED_TX_QUEUE_BD_BASE(QueueNum) \ - (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + (QueueNum<<3)) -#define IPW_MEM_HOST_SHARED_TX_QUEUE_BD_SIZE(QueueNum) \ - (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x0004+(QueueNum<<3)) -#define IPW_MEM_HOST_SHARED_TX_QUEUE_READ_INDEX(QueueNum) \ - (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x0080+(QueueNum<<2)) - -#define IPW_MEM_HOST_SHARED_TX_QUEUE_0_WRITE_INDEX \ - (IPW_MEM_SRAM_HOST_INTERRUPT_AREA_LOWER_BOUND + 0x00) -#define IPW_MEM_HOST_SHARED_TX_QUEUE_1_WRITE_INDEX \ - (IPW_MEM_SRAM_HOST_INTERRUPT_AREA_LOWER_BOUND + 0x04) -#define IPW_MEM_HOST_SHARED_TX_QUEUE_2_WRITE_INDEX \ - (IPW_MEM_SRAM_HOST_INTERRUPT_AREA_LOWER_BOUND + 0x08) -#define IPW_MEM_HOST_SHARED_TX_QUEUE_3_WRITE_INDEX \ - (IPW_MEM_SRAM_HOST_INTERRUPT_AREA_LOWER_BOUND + 0x0c) -#define IPW_MEM_HOST_SHARED_SLAVE_MODE_INT_REGISTER \ - (IPW_MEM_SRAM_HOST_INTERRUPT_AREA_LOWER_BOUND + 0x78) - -#endif - #define IPW_MEM_HOST_SHARED_ORDINALS_TABLE_1 (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x180) #define IPW_MEM_HOST_SHARED_ORDINALS_TABLE_2 (IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x184) -- cgit v1.2.3 From 8724a118031a4eb62174b3e12745e4d35d4b03fe Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Mon, 20 Jun 2005 14:28:43 -0700 Subject: [PATCH] ipw2100: small cleanups Fix few typos/thinkos in ipw, remove ugly macro (it is commented around, anyway), and fix types passed to pci_set_power_state. Signed-off-by: Andrew Morton --- drivers/net/wireless/ipw2100.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'drivers') diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index 832b736e181..62f2935246b 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c @@ -925,7 +925,7 @@ static int sw_reset_and_clock(struct ipw2100_priv *priv) } /********************************************************************* - Procedure : ipw2100_ipw2100_download_firmware + Procedure : ipw2100_download_firmware Purpose : Initiaze adapter after power on. The sequence is: 1. assert s/w reset first! @@ -1192,7 +1192,6 @@ static int ipw2100_get_hw_features(struct ipw2100_priv *priv) */ static int ipw2100_start_adapter(struct ipw2100_priv *priv) { -#define IPW_WAIT_FW_INIT_COMPLETE_DELAY (40 * HZ / 1000) int i; u32 inta, inta_mask, gpio; @@ -1229,7 +1228,7 @@ static int ipw2100_start_adapter(struct ipw2100_priv *priv) i = 5000; do { set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(IPW_WAIT_FW_INIT_COMPLETE_DELAY); + schedule_timeout(40 * HZ / 1000); /* Todo... wait for sync command ... */ read_register(priv->net_dev, IPW_REG_INTA, &inta); @@ -1694,7 +1693,7 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred) } else priv->status |= STATUS_POWERED; - /* Load the firmeware, start the clocks, etc. */ + /* Load the firmware, start the clocks, etc. */ if (ipw2100_start_adapter(priv)) { IPW_DEBUG_ERROR("%s: Failed to start the firmware.\n", priv->net_dev->name); @@ -6498,7 +6497,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev, if ((val & 0x0000ff00) != 0) pci_write_config_dword(pci_dev, 0x40, val & 0xffff00ff); - pci_set_power_state(pci_dev, 0); + pci_set_power_state(pci_dev, PCI_D0); if (!ipw2100_hw_is_adapter_in_system(dev)) { printk(KERN_WARNING DRV_NAME @@ -8034,7 +8033,7 @@ static iw_handler ipw2100_wx_handlers[] = ipw2100_wx_set_wap, /* SIOCSIWAP */ ipw2100_wx_get_wap, /* SIOCGIWAP */ NULL, /* -- hole -- */ - NULL, /* SIOCGIWAPLIST -- depricated */ + NULL, /* SIOCGIWAPLIST -- deprecated */ ipw2100_wx_set_scan, /* SIOCSIWSCAN */ ipw2100_wx_get_scan, /* SIOCGIWSCAN */ ipw2100_wx_set_essid, /* SIOCSIWESSID */ -- cgit v1.2.3 From 011fe95a3b25ff124486fc27dc0395904ecf5852 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Mon, 20 Jun 2005 14:30:36 -0700 Subject: [PATCH] ipw2100 old gcc fix drivers/net/wireless/ipw2100.c: In function `ipw2100_set_key_index': drivers/net/wireless/ipw2100.c:5326: array index in non-array initializer drivers/net/wireless/ipw2100.c:5326: (near initialization for `cmd') drivers/net/wireless/ipw2100.c:5326: warning: missing braces around initializer drivers/net/wireless/ipw2100.c:5326: warning: (near initialization for `cmd.host_command_parameters') Cc: Jeff Garzik Signed-off-by: Andrew Morton --- drivers/net/wireless/ipw2100.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index 62f2935246b..09cc5fdd290 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c @@ -5305,7 +5305,7 @@ static int ipw2100_set_key_index(struct ipw2100_priv *priv, .host_command = WEP_KEY_INDEX, .host_command_sequence = 0, .host_command_length = 4, - .host_command_parameters[0] = idx, + .host_command_parameters = { idx }, }; int err; -- cgit v1.2.3 From edfc43f2ec542c17c479d8ec7e4b0cee7b20f578 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Mon, 20 Jun 2005 14:30:35 -0700 Subject: [PATCH] wireless-device-attr-fixes Repair Jeff's stuff after gregkh depredations. Cc: Jeff Garzik Cc: Greg KH Signed-off-by: Andrew Morton --- drivers/net/wireless/ipw2100.c | 63 ++++++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 24 deletions(-) (limited to 'drivers') diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index 09cc5fdd290..189ad7b2cec 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c @@ -3380,7 +3380,8 @@ static void ipw2100_msg_free(struct ipw2100_priv *priv) priv->msg_buffers = NULL; } -static ssize_t show_pci(struct device *d, char *buf) +static ssize_t show_pci(struct device *d, struct device_attribute *attr, + char *buf) { struct pci_dev *pci_dev = container_of(d, struct pci_dev, dev); char *out = buf; @@ -3400,23 +3401,26 @@ static ssize_t show_pci(struct device *d, char *buf) } static DEVICE_ATTR(pci, S_IRUGO, show_pci, NULL); -static ssize_t show_cfg(struct device *d, char *buf) +static ssize_t show_cfg(struct device *d, struct device_attribute *attr, + char *buf) { - struct ipw2100_priv *p = (struct ipw2100_priv *)d->driver_data; + struct ipw2100_priv *p = d->driver_data; return sprintf(buf, "0x%08x\n", (int)p->config); } static DEVICE_ATTR(cfg, S_IRUGO, show_cfg, NULL); -static ssize_t show_status(struct device *d, char *buf) +static ssize_t show_status(struct device *d, struct device_attribute *attr, + char *buf) { - struct ipw2100_priv *p = (struct ipw2100_priv *)d->driver_data; + struct ipw2100_priv *p = d->driver_data; return sprintf(buf, "0x%08x\n", (int)p->status); } static DEVICE_ATTR(status, S_IRUGO, show_status, NULL); -static ssize_t show_capability(struct device *d, char *buf) +static ssize_t show_capability(struct device *d, struct device_attribute *attr, + char *buf) { - struct ipw2100_priv *p = (struct ipw2100_priv *)d->driver_data; + struct ipw2100_priv *p = d->driver_data; return sprintf(buf, "0x%08x\n", (int)p->capability); } static DEVICE_ATTR(capability, S_IRUGO, show_capability, NULL); @@ -3599,7 +3603,8 @@ const struct { }; -static ssize_t show_registers(struct device *d, char *buf) +static ssize_t show_registers(struct device *d, struct device_attribute *attr, + char *buf) { int i; struct ipw2100_priv *priv = dev_get_drvdata(d); @@ -3620,7 +3625,8 @@ static ssize_t show_registers(struct device *d, char *buf) static DEVICE_ATTR(registers, S_IRUGO, show_registers, NULL); -static ssize_t show_hardware(struct device *d, char *buf) +static ssize_t show_hardware(struct device *d, struct device_attribute *attr, + char *buf) { struct ipw2100_priv *priv = dev_get_drvdata(d); struct net_device *dev = priv->net_dev; @@ -3660,7 +3666,8 @@ static ssize_t show_hardware(struct device *d, char *buf) static DEVICE_ATTR(hardware, S_IRUGO, show_hardware, NULL); -static ssize_t show_memory(struct device *d, char *buf) +static ssize_t show_memory(struct device *d, struct device_attribute *attr, + char *buf) { struct ipw2100_priv *priv = dev_get_drvdata(d); struct net_device *dev = priv->net_dev; @@ -3713,7 +3720,8 @@ static ssize_t show_memory(struct device *d, char *buf) return len; } -static ssize_t store_memory(struct device *d, const char *buf, size_t count) +static ssize_t store_memory(struct device *d, struct device_attribute *attr, + const char *buf, size_t count) { struct ipw2100_priv *priv = dev_get_drvdata(d); struct net_device *dev = priv->net_dev; @@ -3749,7 +3757,8 @@ static ssize_t store_memory(struct device *d, const char *buf, size_t count) static DEVICE_ATTR(memory, S_IWUSR|S_IRUGO, show_memory, store_memory); -static ssize_t show_ordinals(struct device *d, char *buf) +static ssize_t show_ordinals(struct device *d, struct device_attribute *attr, + char *buf) { struct ipw2100_priv *priv = dev_get_drvdata(d); u32 val = 0; @@ -3783,7 +3792,8 @@ static ssize_t show_ordinals(struct device *d, char *buf) static DEVICE_ATTR(ordinals, S_IRUGO, show_ordinals, NULL); -static ssize_t show_stats(struct device *d, char *buf) +static ssize_t show_stats(struct device *d, struct device_attribute *attr, + char *buf) { struct ipw2100_priv *priv = dev_get_drvdata(d); char * out = buf; @@ -3848,7 +3858,8 @@ int ipw2100_switch_mode(struct ipw2100_priv *priv, u32 mode) return 0; } -static ssize_t show_internals(struct device *d, char *buf) +static ssize_t show_internals(struct device *d, struct device_attribute *attr, + char *buf) { struct ipw2100_priv *priv = dev_get_drvdata(d); int len = 0; @@ -3899,7 +3910,8 @@ static ssize_t show_internals(struct device *d, char *buf) static DEVICE_ATTR(internals, S_IRUGO, show_internals, NULL); -static ssize_t show_bssinfo(struct device *d, char *buf) +static ssize_t show_bssinfo(struct device *d, struct device_attribute *attr, + char *buf) { struct ipw2100_priv *priv = dev_get_drvdata(d); char essid[IW_ESSID_MAX_SIZE + 1]; @@ -3942,8 +3954,6 @@ static ssize_t show_bssinfo(struct device *d, char *buf) static DEVICE_ATTR(bssinfo, S_IRUGO, show_bssinfo, NULL); - - #ifdef CONFIG_IPW_DEBUG static ssize_t show_debug_level(struct device_driver *d, char *buf) { @@ -3976,7 +3986,8 @@ static DRIVER_ATTR(debug_level, S_IWUSR | S_IRUGO, show_debug_level, #endif /* CONFIG_IPW_DEBUG */ -static ssize_t show_fatal_error(struct device *d, char *buf) +static ssize_t show_fatal_error(struct device *d, + struct device_attribute *attr, char *buf) { struct ipw2100_priv *priv = dev_get_drvdata(d); char *out = buf; @@ -4001,8 +4012,8 @@ static ssize_t show_fatal_error(struct device *d, char *buf) return out - buf; } -static ssize_t store_fatal_error(struct device *d, const char *buf, - size_t count) +static ssize_t store_fatal_error(struct device *d, + struct device_attribute *attr, const char *buf, size_t count) { struct ipw2100_priv *priv = dev_get_drvdata(d); schedule_reset(priv); @@ -4011,13 +4022,15 @@ static ssize_t store_fatal_error(struct device *d, const char *buf, static DEVICE_ATTR(fatal_error, S_IWUSR|S_IRUGO, show_fatal_error, store_fatal_error); -static ssize_t show_scan_age(struct device *d, char *buf) +static ssize_t show_scan_age(struct device *d, struct device_attribute *attr, + char *buf) { struct ipw2100_priv *priv = dev_get_drvdata(d); return sprintf(buf, "%d\n", priv->ieee->scan_age); } -static ssize_t store_scan_age(struct device *d, const char *buf, size_t count) +static ssize_t store_scan_age(struct device *d, struct device_attribute *attr, + const char *buf, size_t count) { struct ipw2100_priv *priv = dev_get_drvdata(d); struct net_device *dev = priv->net_dev; @@ -4053,7 +4066,8 @@ static ssize_t store_scan_age(struct device *d, const char *buf, size_t count) static DEVICE_ATTR(scan_age, S_IWUSR | S_IRUGO, show_scan_age, store_scan_age); -static ssize_t show_rf_kill(struct device *d, char *buf) +static ssize_t show_rf_kill(struct device *d, struct device_attribute *attr, + char *buf) { /* 0 - RF kill not enabled 1 - SW based RF kill active (sysfs) @@ -4097,7 +4111,8 @@ static int ipw_radio_kill_sw(struct ipw2100_priv *priv, int disable_radio) return 1; } -static ssize_t store_rf_kill(struct device *d, const char *buf, size_t count) +static ssize_t store_rf_kill(struct device *d, struct device_attribute *attr, + const char *buf, size_t count) { struct ipw2100_priv *priv = dev_get_drvdata(d); ipw_radio_kill_sw(priv, buf[0] == '1'); -- cgit v1.2.3 From ad3fee560bc508008b3b2cf6358105c4c7081921 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Mon, 20 Jun 2005 14:30:36 -0700 Subject: [PATCH] wireless-device-attr-fixes-2 More fixes for greg depredations. Also nuke lots of pointless typecasts. All this new wireless code adds near-infinite amounts of trailing whitespace. Cc: Jeff Garzik Cc: Greg KH Signed-off-by: Andrew Morton --- drivers/net/wireless/ipw2200.c | 122 +++++++++++++++++++++++------------------ 1 file changed, 68 insertions(+), 54 deletions(-) (limited to 'drivers') diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index 343838a5327..16cfd907e71 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c @@ -642,8 +642,8 @@ static ssize_t show_debug_level(struct device_driver *d, char *buf) { return sprintf(buf, "0x%08X\n", ipw_debug_level); } -static ssize_t store_debug_level(struct device_driver *d, const char *buf, - size_t count) +static ssize_t store_debug_level(struct device_driver *d, + const char *buf, size_t count) { char *p = (char *)buf; u32 val; @@ -667,23 +667,26 @@ static ssize_t store_debug_level(struct device_driver *d, const char *buf, static DRIVER_ATTR(debug_level, S_IWUSR | S_IRUGO, show_debug_level, store_debug_level); -static ssize_t show_status(struct device *d, char *buf) +static ssize_t show_status(struct device *d, + struct device_attribute *attr, char *buf) { - struct ipw_priv *p = (struct ipw_priv *)d->driver_data; + struct ipw_priv *p = d->driver_data; return sprintf(buf, "0x%08x\n", (int)p->status); } static DEVICE_ATTR(status, S_IRUGO, show_status, NULL); -static ssize_t show_cfg(struct device *d, char *buf) +static ssize_t show_cfg(struct device *d, struct device_attribute *attr, + char *buf) { - struct ipw_priv *p = (struct ipw_priv *)d->driver_data; + struct ipw_priv *p = d->driver_data; return sprintf(buf, "0x%08x\n", (int)p->config); } static DEVICE_ATTR(cfg, S_IRUGO, show_cfg, NULL); -static ssize_t show_nic_type(struct device *d, char *buf) +static ssize_t show_nic_type(struct device *d, + struct device_attribute *attr, char *buf) { - struct ipw_priv *p = (struct ipw_priv *)d->driver_data; + struct ipw_priv *p = d->driver_data; u8 type = p->eeprom[EEPROM_NIC_TYPE]; switch (type) { @@ -703,8 +706,8 @@ static ssize_t show_nic_type(struct device *d, char *buf) } static DEVICE_ATTR(nic_type, S_IRUGO, show_nic_type, NULL); -static ssize_t dump_error_log(struct device *d, const char *buf, - size_t count) +static ssize_t dump_error_log(struct device *d, + struct device_attribute *attr, const char *buf, size_t count) { char *p = (char *)buf; @@ -715,8 +718,8 @@ static ssize_t dump_error_log(struct device *d, const char *buf, } static DEVICE_ATTR(dump_errors, S_IWUSR, NULL, dump_error_log); -static ssize_t dump_event_log(struct device *d, const char *buf, - size_t count) +static ssize_t dump_event_log(struct device *d, + struct device_attribute *attr, const char *buf, size_t count) { char *p = (char *)buf; @@ -727,10 +730,11 @@ static ssize_t dump_event_log(struct device *d, const char *buf, } static DEVICE_ATTR(dump_events, S_IWUSR, NULL, dump_event_log); -static ssize_t show_ucode_version(struct device *d, char *buf) +static ssize_t show_ucode_version(struct device *d, + struct device_attribute *attr, char *buf) { u32 len = sizeof(u32), tmp = 0; - struct ipw_priv *p = (struct ipw_priv*)d->driver_data; + struct ipw_priv *p = d->driver_data; if(ipw_get_ordinal(p, IPW_ORD_STAT_UCODE_VERSION, &tmp, &len)) return 0; @@ -739,10 +743,11 @@ static ssize_t show_ucode_version(struct device *d, char *buf) } static DEVICE_ATTR(ucode_version, S_IWUSR|S_IRUGO, show_ucode_version, NULL); -static ssize_t show_rtc(struct device *d, char *buf) +static ssize_t show_rtc(struct device *d, struct device_attribute *attr, + char *buf) { u32 len = sizeof(u32), tmp = 0; - struct ipw_priv *p = (struct ipw_priv*)d->driver_data; + struct ipw_priv *p = d->driver_data; if(ipw_get_ordinal(p, IPW_ORD_STAT_RTC, &tmp, &len)) return 0; @@ -755,35 +760,38 @@ static DEVICE_ATTR(rtc, S_IWUSR|S_IRUGO, show_rtc, NULL); * Add a device attribute to view/control the delay between eeprom * operations. */ -static ssize_t show_eeprom_delay(struct device *d, char *buf) +static ssize_t show_eeprom_delay(struct device *d, + struct device_attribute *attr, char *buf) { int n = ((struct ipw_priv*)d->driver_data)->eeprom_delay; return sprintf(buf, "%i\n", n); } -static ssize_t store_eeprom_delay(struct device *d, const char *buf, - size_t count) +static ssize_t store_eeprom_delay(struct device *d, + struct device_attribute *attr, const char *buf, + size_t count) { - struct ipw_priv *p = (struct ipw_priv*)d->driver_data; + struct ipw_priv *p = d->driver_data; sscanf(buf, "%i", &p->eeprom_delay); return strnlen(buf, count); } static DEVICE_ATTR(eeprom_delay, S_IWUSR|S_IRUGO, show_eeprom_delay,store_eeprom_delay); -static ssize_t show_command_event_reg(struct device *d, char *buf) +static ssize_t show_command_event_reg(struct device *d, + struct device_attribute *attr, char *buf) { u32 reg = 0; - struct ipw_priv *p = (struct ipw_priv *)d->driver_data; + struct ipw_priv *p = d->driver_data; reg = ipw_read_reg32(p, CX2_INTERNAL_CMD_EVENT); return sprintf(buf, "0x%08x\n", reg); } -static ssize_t store_command_event_reg(struct device *d, - const char *buf, - size_t count) +static ssize_t store_command_event_reg(struct device *d, + struct device_attribute *attr, const char *buf, + size_t count) { u32 reg; - struct ipw_priv *p = (struct ipw_priv *)d->driver_data; + struct ipw_priv *p = d->driver_data; sscanf(buf, "%x", ®); ipw_write_reg32(p, CX2_INTERNAL_CMD_EVENT, reg); @@ -792,20 +800,21 @@ static ssize_t store_command_event_reg(struct device *d, static DEVICE_ATTR(command_event_reg, S_IWUSR|S_IRUGO, show_command_event_reg,store_command_event_reg); -static ssize_t show_mem_gpio_reg(struct device *d, char *buf) +static ssize_t show_mem_gpio_reg(struct device *d, + struct device_attribute *attr, char *buf) { u32 reg = 0; - struct ipw_priv *p = (struct ipw_priv *)d->driver_data; + struct ipw_priv *p = d->driver_data; reg = ipw_read_reg32(p, 0x301100); return sprintf(buf, "0x%08x\n", reg); } -static ssize_t store_mem_gpio_reg(struct device *d, - const char *buf, - size_t count) +static ssize_t store_mem_gpio_reg(struct device *d, + struct device_attribute *attr, const char *buf, + size_t count) { u32 reg; - struct ipw_priv *p = (struct ipw_priv *)d->driver_data; + struct ipw_priv *p = d->driver_data; sscanf(buf, "%x", ®); ipw_write_reg32(p, 0x301100, reg); @@ -814,10 +823,11 @@ static ssize_t store_mem_gpio_reg(struct device *d, static DEVICE_ATTR(mem_gpio_reg, S_IWUSR|S_IRUGO, show_mem_gpio_reg,store_mem_gpio_reg); -static ssize_t show_indirect_dword(struct device *d, char *buf) +static ssize_t show_indirect_dword(struct device *d, + struct device_attribute *attr, char *buf) { u32 reg = 0; - struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; + struct ipw_priv *priv = d->driver_data; if (priv->status & STATUS_INDIRECT_DWORD) reg = ipw_read_reg32(priv, priv->indirect_dword); else @@ -825,11 +835,11 @@ static ssize_t show_indirect_dword(struct device *d, char *buf) return sprintf(buf, "0x%08x\n", reg); } -static ssize_t store_indirect_dword(struct device *d, - const char *buf, - size_t count) +static ssize_t store_indirect_dword(struct device *d, + struct device_attribute *attr, const char *buf, + size_t count) { - struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; + struct ipw_priv *priv = d->driver_data; sscanf(buf, "%x", &priv->indirect_dword); priv->status |= STATUS_INDIRECT_DWORD; @@ -838,10 +848,11 @@ static ssize_t store_indirect_dword(struct device *d, static DEVICE_ATTR(indirect_dword, S_IWUSR|S_IRUGO, show_indirect_dword,store_indirect_dword); -static ssize_t show_indirect_byte(struct device *d, char *buf) +static ssize_t show_indirect_byte(struct device *d, + struct device_attribute *attr, char *buf) { u8 reg = 0; - struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; + struct ipw_priv *priv = d->driver_data; if (priv->status & STATUS_INDIRECT_BYTE) reg = ipw_read_reg8(priv, priv->indirect_byte); else @@ -849,11 +860,11 @@ static ssize_t show_indirect_byte(struct device *d, char *buf) return sprintf(buf, "0x%02x\n", reg); } -static ssize_t store_indirect_byte(struct device *d, - const char *buf, - size_t count) +static ssize_t store_indirect_byte(struct device *d, + struct device_attribute *attr, const char *buf, + size_t count) { - struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; + struct ipw_priv *priv = d->driver_data; sscanf(buf, "%x", &priv->indirect_byte); priv->status |= STATUS_INDIRECT_BYTE; @@ -862,10 +873,11 @@ static ssize_t store_indirect_byte(struct device *d, static DEVICE_ATTR(indirect_byte, S_IWUSR|S_IRUGO, show_indirect_byte, store_indirect_byte); -static ssize_t show_direct_dword(struct device *d, char *buf) +static ssize_t show_direct_dword(struct device *d, + struct device_attribute *attr, char *buf) { u32 reg = 0; - struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; + struct ipw_priv *priv = d->driver_data; if (priv->status & STATUS_DIRECT_DWORD) reg = ipw_read32(priv, priv->direct_dword); @@ -874,11 +886,11 @@ static ssize_t show_direct_dword(struct device *d, char *buf) return sprintf(buf, "0x%08x\n", reg); } -static ssize_t store_direct_dword(struct device *d, - const char *buf, - size_t count) +static ssize_t store_direct_dword(struct device *d, + struct device_attribute *attr, const char *buf, + size_t count) { - struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; + struct ipw_priv *priv = d->driver_data; sscanf(buf, "%x", &priv->direct_dword); priv->status |= STATUS_DIRECT_DWORD; @@ -898,13 +910,14 @@ static inline int rf_kill_active(struct ipw_priv *priv) return (priv->status & STATUS_RF_KILL_HW) ? 1 : 0; } -static ssize_t show_rf_kill(struct device *d, char *buf) +static ssize_t show_rf_kill(struct device *d, struct device_attribute *attr, + char *buf) { /* 0 - RF kill not enabled 1 - SW based RF kill active (sysfs) 2 - HW based RF kill active 3 - Both HW and SW baed RF kill active */ - struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; + struct ipw_priv *priv = d->driver_data; int val = ((priv->status & STATUS_RF_KILL_SW) ? 0x1 : 0x0) | (rf_kill_active(priv) ? 0x2 : 0x0); return sprintf(buf, "%i\n", val); @@ -943,9 +956,10 @@ static int ipw_radio_kill_sw(struct ipw_priv *priv, int disable_radio) return 1; } -static ssize_t store_rf_kill(struct device *d, const char *buf, size_t count) +static ssize_t store_rf_kill(struct device *d, struct device_attribute *attr, + const char *buf, size_t count) { - struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; + struct ipw_priv *priv = d->driver_data; ipw_radio_kill_sw(priv, buf[0] == '1'); -- cgit v1.2.3