aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorviro@ftp.linux.org.uk <viro@ftp.linux.org.uk>2005-09-04 22:26:08 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-09-05 17:57:23 -0400
commit2be041a79bbdbb3c830f4cc3bc3387ba6fff7566 (patch)
treeed5046a687022c652a7420fbc60f33b465db6d3b /drivers/net
parent6cafa99f01ee355bf2590a45f0f7d236fe6bdca8 (diff)
[PATCH] (5/7) iomem annotations, NULL noise removal (ipw2100)
Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ipw2100.c69
1 files changed, 35 insertions, 34 deletions
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index a47fce4bead..2414e6493aa 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -327,38 +327,38 @@ static struct iw_handler_def ipw2100_wx_handler_def;
327 327
328static inline void read_register(struct net_device *dev, u32 reg, u32 *val) 328static inline void read_register(struct net_device *dev, u32 reg, u32 *val)
329{ 329{
330 *val = readl((void *)(dev->base_addr + reg)); 330 *val = readl((void __iomem *)(dev->base_addr + reg));
331 IPW_DEBUG_IO("r: 0x%08X => 0x%08X\n", reg, *val); 331 IPW_DEBUG_IO("r: 0x%08X => 0x%08X\n", reg, *val);
332} 332}
333 333
334static inline void write_register(struct net_device *dev, u32 reg, u32 val) 334static inline void write_register(struct net_device *dev, u32 reg, u32 val)
335{ 335{
336 writel(val, (void *)(dev->base_addr + reg)); 336 writel(val, (void __iomem *)(dev->base_addr + reg));
337 IPW_DEBUG_IO("w: 0x%08X <= 0x%08X\n", reg, val); 337 IPW_DEBUG_IO("w: 0x%08X <= 0x%08X\n", reg, val);
338} 338}
339 339
340static inline void read_register_word(struct net_device *dev, u32 reg, u16 *val) 340static inline void read_register_word(struct net_device *dev, u32 reg, u16 *val)
341{ 341{
342 *val = readw((void *)(dev->base_addr + reg)); 342 *val = readw((void __iomem *)(dev->base_addr + reg));
343 IPW_DEBUG_IO("r: 0x%08X => %04X\n", reg, *val); 343 IPW_DEBUG_IO("r: 0x%08X => %04X\n", reg, *val);
344} 344}
345 345
346static inline void read_register_byte(struct net_device *dev, u32 reg, u8 *val) 346static inline void read_register_byte(struct net_device *dev, u32 reg, u8 *val)
347{ 347{
348 *val = readb((void *)(dev->base_addr + reg)); 348 *val = readb((void __iomem *)(dev->base_addr + reg));
349 IPW_DEBUG_IO("r: 0x%08X => %02X\n", reg, *val); 349 IPW_DEBUG_IO("r: 0x%08X => %02X\n", reg, *val);
350} 350}
351 351
352static inline void write_register_word(struct net_device *dev, u32 reg, u16 val) 352static inline void write_register_word(struct net_device *dev, u32 reg, u16 val)
353{ 353{
354 writew(val, (void *)(dev->base_addr + reg)); 354 writew(val, (void __iomem *)(dev->base_addr + reg));
355 IPW_DEBUG_IO("w: 0x%08X <= %04X\n", reg, val); 355 IPW_DEBUG_IO("w: 0x%08X <= %04X\n", reg, val);
356} 356}
357 357
358 358
359static inline void write_register_byte(struct net_device *dev, u32 reg, u8 val) 359static inline void write_register_byte(struct net_device *dev, u32 reg, u8 val)
360{ 360{
361 writeb(val, (void *)(dev->base_addr + reg)); 361 writeb(val, (void __iomem *)(dev->base_addr + reg));
362 IPW_DEBUG_IO("w: 0x%08X =< %02X\n", reg, val); 362 IPW_DEBUG_IO("w: 0x%08X =< %02X\n", reg, val);
363} 363}
364 364
@@ -498,7 +498,7 @@ static inline void read_nic_memory(struct net_device *dev, u32 addr, u32 len,
498static inline int ipw2100_hw_is_adapter_in_system(struct net_device *dev) 498static inline int ipw2100_hw_is_adapter_in_system(struct net_device *dev)
499{ 499{
500 return (dev->base_addr && 500 return (dev->base_addr &&
501 (readl((void *)(dev->base_addr + IPW_REG_DOA_DEBUG_AREA_START)) 501 (readl((void __iomem *)(dev->base_addr + IPW_REG_DOA_DEBUG_AREA_START))
502 == IPW_DATA_DOA_DEBUG_VALUE)); 502 == IPW_DATA_DOA_DEBUG_VALUE));
503} 503}
504 504
@@ -2125,19 +2125,19 @@ static void isr_indicate_scanning(struct ipw2100_priv *priv, u32 status)
2125} 2125}
2126 2126
2127static const struct ipw2100_status_indicator status_handlers[] = { 2127static const struct ipw2100_status_indicator status_handlers[] = {
2128 IPW2100_HANDLER(IPW_STATE_INITIALIZED, 0), 2128 IPW2100_HANDLER(IPW_STATE_INITIALIZED, NULL),
2129 IPW2100_HANDLER(IPW_STATE_COUNTRY_FOUND, 0), 2129 IPW2100_HANDLER(IPW_STATE_COUNTRY_FOUND, NULL),
2130 IPW2100_HANDLER(IPW_STATE_ASSOCIATED, isr_indicate_associated), 2130 IPW2100_HANDLER(IPW_STATE_ASSOCIATED, isr_indicate_associated),
2131 IPW2100_HANDLER(IPW_STATE_ASSN_LOST, isr_indicate_association_lost), 2131 IPW2100_HANDLER(IPW_STATE_ASSN_LOST, isr_indicate_association_lost),
2132 IPW2100_HANDLER(IPW_STATE_ASSN_CHANGED, 0), 2132 IPW2100_HANDLER(IPW_STATE_ASSN_CHANGED, NULL),
2133 IPW2100_HANDLER(IPW_STATE_SCAN_COMPLETE, isr_scan_complete), 2133 IPW2100_HANDLER(IPW_STATE_SCAN_COMPLETE, isr_scan_complete),
2134 IPW2100_HANDLER(IPW_STATE_ENTERED_PSP, 0), 2134 IPW2100_HANDLER(IPW_STATE_ENTERED_PSP, NULL),
2135 IPW2100_HANDLER(IPW_STATE_LEFT_PSP, 0), 2135 IPW2100_HANDLER(IPW_STATE_LEFT_PSP, NULL),
2136 IPW2100_HANDLER(IPW_STATE_RF_KILL, isr_indicate_rf_kill), 2136 IPW2100_HANDLER(IPW_STATE_RF_KILL, isr_indicate_rf_kill),
2137 IPW2100_HANDLER(IPW_STATE_DISABLED, 0), 2137 IPW2100_HANDLER(IPW_STATE_DISABLED, NULL),
2138 IPW2100_HANDLER(IPW_STATE_POWER_DOWN, 0), 2138 IPW2100_HANDLER(IPW_STATE_POWER_DOWN, NULL),
2139 IPW2100_HANDLER(IPW_STATE_SCANNING, isr_indicate_scanning), 2139 IPW2100_HANDLER(IPW_STATE_SCANNING, isr_indicate_scanning),
2140 IPW2100_HANDLER(-1, 0) 2140 IPW2100_HANDLER(-1, NULL)
2141}; 2141};
2142 2142
2143 2143
@@ -6327,7 +6327,7 @@ static void ipw2100_irq_tasklet(struct ipw2100_priv *priv);
6327 6327
6328static struct net_device *ipw2100_alloc_device( 6328static struct net_device *ipw2100_alloc_device(
6329 struct pci_dev *pci_dev, 6329 struct pci_dev *pci_dev,
6330 char *base_addr, 6330 void __iomem *base_addr,
6331 unsigned long mem_start, 6331 unsigned long mem_start,
6332 unsigned long mem_len) 6332 unsigned long mem_len)
6333{ 6333{
@@ -6474,7 +6474,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
6474 const struct pci_device_id *ent) 6474 const struct pci_device_id *ent)
6475{ 6475{
6476 unsigned long mem_start, mem_len, mem_flags; 6476 unsigned long mem_start, mem_len, mem_flags;
6477 char *base_addr = NULL; 6477 void __iomem *base_addr = NULL;
6478 struct net_device *dev = NULL; 6478 struct net_device *dev = NULL;
6479 struct ipw2100_priv *priv = NULL; 6479 struct ipw2100_priv *priv = NULL;
6480 int err = 0; 6480 int err = 0;
@@ -6664,7 +6664,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
6664 } 6664 }
6665 6665
6666 if (base_addr) 6666 if (base_addr)
6667 iounmap((char*)base_addr); 6667 iounmap(base_addr);
6668 6668
6669 pci_release_regions(pci_dev); 6669 pci_release_regions(pci_dev);
6670 pci_disable_device(pci_dev); 6670 pci_disable_device(pci_dev);
@@ -6714,7 +6714,7 @@ static void __devexit ipw2100_pci_remove_one(struct pci_dev *pci_dev)
6714 free_irq(dev->irq, priv); 6714 free_irq(dev->irq, priv);
6715 6715
6716 if (dev->base_addr) 6716 if (dev->base_addr)
6717 iounmap((unsigned char *)dev->base_addr); 6717 iounmap((void __iomem *)dev->base_addr);
6718 6718
6719 free_ieee80211(dev); 6719 free_ieee80211(dev);
6720 } 6720 }
@@ -8574,6 +8574,7 @@ static int ipw2100_ucode_download(struct ipw2100_priv *priv,
8574 struct net_device *dev = priv->net_dev; 8574 struct net_device *dev = priv->net_dev;
8575 const unsigned char *microcode_data = fw->uc.data; 8575 const unsigned char *microcode_data = fw->uc.data;
8576 unsigned int microcode_data_left = fw->uc.size; 8576 unsigned int microcode_data_left = fw->uc.size;
8577 void __iomem *reg = (void __iomem *)dev->base_addr;
8577 8578
8578 struct symbol_alive_response response; 8579 struct symbol_alive_response response;
8579 int i, j; 8580 int i, j;
@@ -8581,23 +8582,23 @@ static int ipw2100_ucode_download(struct ipw2100_priv *priv,
8581 8582
8582 /* Symbol control */ 8583 /* Symbol control */
8583 write_nic_word(dev, IPW2100_CONTROL_REG, 0x703); 8584 write_nic_word(dev, IPW2100_CONTROL_REG, 0x703);
8584 readl((void *)(dev->base_addr)); 8585 readl(reg);
8585 write_nic_word(dev, IPW2100_CONTROL_REG, 0x707); 8586 write_nic_word(dev, IPW2100_CONTROL_REG, 0x707);
8586 readl((void *)(dev->base_addr)); 8587 readl(reg);
8587 8588
8588 /* HW config */ 8589 /* HW config */
8589 write_nic_byte(dev, 0x210014, 0x72); /* fifo width =16 */ 8590 write_nic_byte(dev, 0x210014, 0x72); /* fifo width =16 */
8590 readl((void *)(dev->base_addr)); 8591 readl(reg);
8591 write_nic_byte(dev, 0x210014, 0x72); /* fifo width =16 */ 8592 write_nic_byte(dev, 0x210014, 0x72); /* fifo width =16 */
8592 readl((void *)(dev->base_addr)); 8593 readl(reg);
8593 8594
8594 /* EN_CS_ACCESS bit to reset control store pointer */ 8595 /* EN_CS_ACCESS bit to reset control store pointer */
8595 write_nic_byte(dev, 0x210000, 0x40); 8596 write_nic_byte(dev, 0x210000, 0x40);
8596 readl((void *)(dev->base_addr)); 8597 readl(reg);
8597 write_nic_byte(dev, 0x210000, 0x0); 8598 write_nic_byte(dev, 0x210000, 0x0);
8598 readl((void *)(dev->base_addr)); 8599 readl(reg);
8599 write_nic_byte(dev, 0x210000, 0x40); 8600 write_nic_byte(dev, 0x210000, 0x40);
8600 readl((void *)(dev->base_addr)); 8601 readl(reg);
8601 8602
8602 /* copy microcode from buffer into Symbol */ 8603 /* copy microcode from buffer into Symbol */
8603 8604
@@ -8609,31 +8610,31 @@ static int ipw2100_ucode_download(struct ipw2100_priv *priv,
8609 8610
8610 /* EN_CS_ACCESS bit to reset the control store pointer */ 8611 /* EN_CS_ACCESS bit to reset the control store pointer */
8611 write_nic_byte(dev, 0x210000, 0x0); 8612 write_nic_byte(dev, 0x210000, 0x0);
8612 readl((void *)(dev->base_addr)); 8613 readl(reg);
8613 8614
8614 /* Enable System (Reg 0) 8615 /* Enable System (Reg 0)
8615 * first enable causes garbage in RX FIFO */ 8616 * first enable causes garbage in RX FIFO */
8616 write_nic_byte(dev, 0x210000, 0x0); 8617 write_nic_byte(dev, 0x210000, 0x0);
8617 readl((void *)(dev->base_addr)); 8618 readl(reg);
8618 write_nic_byte(dev, 0x210000, 0x80); 8619 write_nic_byte(dev, 0x210000, 0x80);
8619 readl((void *)(dev->base_addr)); 8620 readl(reg);
8620 8621
8621 /* Reset External Baseband Reg */ 8622 /* Reset External Baseband Reg */
8622 write_nic_word(dev, IPW2100_CONTROL_REG, 0x703); 8623 write_nic_word(dev, IPW2100_CONTROL_REG, 0x703);
8623 readl((void *)(dev->base_addr)); 8624 readl(reg);
8624 write_nic_word(dev, IPW2100_CONTROL_REG, 0x707); 8625 write_nic_word(dev, IPW2100_CONTROL_REG, 0x707);
8625 readl((void *)(dev->base_addr)); 8626 readl(reg);
8626 8627
8627 /* HW Config (Reg 5) */ 8628 /* HW Config (Reg 5) */
8628 write_nic_byte(dev, 0x210014, 0x72); // fifo width =16 8629 write_nic_byte(dev, 0x210014, 0x72); // fifo width =16
8629 readl((void *)(dev->base_addr)); 8630 readl(reg);
8630 write_nic_byte(dev, 0x210014, 0x72); // fifo width =16 8631 write_nic_byte(dev, 0x210014, 0x72); // fifo width =16
8631 readl((void *)(dev->base_addr)); 8632 readl(reg);
8632 8633
8633 /* Enable System (Reg 0) 8634 /* Enable System (Reg 0)
8634 * second enable should be OK */ 8635 * second enable should be OK */
8635 write_nic_byte(dev, 0x210000, 0x00); // clear enable system 8636 write_nic_byte(dev, 0x210000, 0x00); // clear enable system
8636 readl((void *)(dev->base_addr)); 8637 readl(reg);
8637 write_nic_byte(dev, 0x210000, 0x80); // set enable system 8638 write_nic_byte(dev, 0x210000, 0x80); // set enable system
8638 8639
8639 /* check Symbol is enabled - upped this from 5 as it wasn't always 8640 /* check Symbol is enabled - upped this from 5 as it wasn't always