diff options
author | Ingo Molnar | 2009-08-23 11:18:47 +0200 |
---|---|---|
committer | Ingo Molnar | 2009-08-23 11:18:47 +0200 |
commit | 8a517c514d5893602cf85c1b4c47afbbc04d2198 (patch) | |
tree | e7c40f68ef97bb2bdb4c366c0b45437bc049feb1 /drivers/staging/agnx | |
parent | x86, cpu: cpu/proc.c display cache alignment and address sizes for 32 bit (diff) | |
parent | Linux 2.6.31-rc7 (diff) | |
download | kernel-qcow2-linux-8a517c514d5893602cf85c1b4c47afbbc04d2198.tar.gz kernel-qcow2-linux-8a517c514d5893602cf85c1b4c47afbbc04d2198.tar.xz kernel-qcow2-linux-8a517c514d5893602cf85c1b4c47afbbc04d2198.zip |
Merge commit 'v2.6.31-rc7' into x86/cpu
Diffstat (limited to 'drivers/staging/agnx')
-rw-r--r-- | drivers/staging/agnx/debug.h | 9 | ||||
-rw-r--r-- | drivers/staging/agnx/pci.c | 72 | ||||
-rw-r--r-- | drivers/staging/agnx/phy.c | 4 | ||||
-rw-r--r-- | drivers/staging/agnx/phy.h | 2 | ||||
-rw-r--r-- | drivers/staging/agnx/sta.c | 2 | ||||
-rw-r--r-- | drivers/staging/agnx/sta.h | 2 |
6 files changed, 41 insertions, 50 deletions
diff --git a/drivers/staging/agnx/debug.h b/drivers/staging/agnx/debug.h index 761d99c2d3f0..7947f327a214 100644 --- a/drivers/staging/agnx/debug.h +++ b/drivers/staging/agnx/debug.h @@ -312,7 +312,6 @@ static inline void dump_ieee80211_hdr(struct ieee80211_hdr *hdr, char *tag) { u16 fctl; int hdrlen; - DECLARE_MAC_BUF(mac); fctl = le16_to_cpu(hdr->frame_control); switch (fctl & IEEE80211_FCTL_FTYPE) { @@ -375,13 +374,13 @@ static inline void dump_ieee80211_hdr(struct ieee80211_hdr *hdr, char *tag) printk("FC=0x%04x DUR=0x%04x", fctl, le16_to_cpu(hdr->duration_id)); if (hdrlen >= 10) - printk(" A1=%s", print_mac(mac, hdr->addr1)); + printk(" A1=%pM", hdr->addr1); if (hdrlen >= 16) - printk(" A2=%s", print_mac(mac, hdr->addr2)); + printk(" A2=%pM", hdr->addr2); if (hdrlen >= 24) - printk(" A3=%s", print_mac(mac, hdr->addr3)); + printk(" A3=%pM", hdr->addr3); if (hdrlen >= 30) - printk(" A4=%s", print_mac(mac, hdr->addr4)); + printk(" A4=%pM", hdr->addr4); printk("\n"); } diff --git a/drivers/staging/agnx/pci.c b/drivers/staging/agnx/pci.c index 25c0ffd2faa0..1fe987065257 100644 --- a/drivers/staging/agnx/pci.c +++ b/drivers/staging/agnx/pci.c @@ -58,15 +58,17 @@ static inline void agnx_interrupt_ack(struct agnx_priv *priv, u32 *reason) *reason |= AGNX_STAT_TXM; } } -/* if (*reason & AGNX_STAT_X) { +#if 0 + if (*reason & AGNX_STAT_X) { reg = ioread32(ctl + AGNX_INT_STAT); iowrite32(reg, ctl + AGNX_INT_STAT); - /* FIXME reinit interrupt mask *\/ + /* FIXME reinit interrupt mask */ reg = 0xc390bf9 & ~IRQ_TX_BEACON; reg &= ~IRQ_TX_DISABLE; iowrite32(reg, ctl + AGNX_INT_MASK); iowrite32(0x800, ctl + AGNX_CIR_BLKCTL); - } */ + } +#endif } /* agnx_interrupt_ack */ static irqreturn_t agnx_interrupt_handler(int irq, void *dev_id) @@ -150,8 +152,7 @@ static int agnx_get_mac_address(struct agnx_priv *priv) *((u32 *)(priv->mac_addr + 2)) = cpu_to_le32(reg); if (!is_valid_ether_addr(priv->mac_addr)) { - DECLARE_MAC_BUF(mbuf); - printk(KERN_WARNING PFX "read mac %s\n", print_mac(mbuf, priv->mac_addr)); + printk(KERN_WARNING PFX "read mac %pM\n", priv->mac_addr); printk(KERN_WARNING PFX "Invalid hwaddr! Using random hwaddr\n"); random_ether_addr(priv->mac_addr); } @@ -220,7 +221,7 @@ static void agnx_periodic_work_handler(struct work_struct *work) /* TODO Recalibrate*/ /* calibrate_oscillator(priv); */ /* antenna_calibrate(priv); */ -/* agnx_send_packet(priv, 997); / +/* agnx_send_packet(priv, 997); */ /* FIXME */ /* if (debug == 3) */ /* delay = msecs_to_jiffies(AGNX_PERIODIC_DELAY); */ @@ -303,14 +304,18 @@ static int agnx_config(struct ieee80211_hw *dev, u32 changed) return 0; } -static int agnx_config_interface(struct ieee80211_hw *dev, - struct ieee80211_vif *vif, - struct ieee80211_if_conf *conf) +static void agnx_bss_info_changed(struct ieee80211_hw *dev, + struct ieee80211_vif *vif, + struct ieee80211_bss_conf *conf, + u32 changed) { struct agnx_priv *priv = dev->priv; void __iomem *ctl = priv->ctl; AGNX_TRACE; + if (!(changed & BSS_CHANGED_BSSID)) + return; + spin_lock(&priv->lock); if (memcmp(conf->bssid, priv->bssid, ETH_ALEN)) { @@ -323,8 +328,7 @@ static int agnx_config_interface(struct ieee80211_hw *dev, agnx_write32(ctl, AGNX_BM_MTSM, 0xff & ~0x1); } spin_unlock(&priv->lock); - return 0; -} /* agnx_config_interface */ +} /* agnx_bss_info_changed */ static void agnx_configure_filter(struct ieee80211_hw *dev, @@ -422,7 +426,7 @@ static struct ieee80211_ops agnx_ops = { .add_interface = agnx_add_interface, .remove_interface = agnx_remove_interface, .config = agnx_config, - .config_interface = agnx_config_interface, + .bss_info_changed = agnx_bss_info_changed, .configure_filter = agnx_configure_filter, .get_stats = agnx_get_stats, .get_tx_stats = agnx_get_tx_stats, @@ -452,47 +456,35 @@ static int __devinit agnx_pci_probe(struct pci_dev *pdev, { struct ieee80211_hw *dev; struct agnx_priv *priv; - u32 mem_addr0, mem_len0; - u32 mem_addr1, mem_len1; int err; - DECLARE_MAC_BUF(mac); err = pci_enable_device(pdev); if (err) { - printk(KERN_ERR PFX "Can't enable new PCI device\n"); + dev_err(&pdev->dev, "can't enable pci device\n"); return err; } - /* get pci resource */ - mem_addr0 = pci_resource_start(pdev, 0); - mem_len0 = pci_resource_len(pdev, 0); - mem_addr1 = pci_resource_start(pdev, 1); - mem_len1 = pci_resource_len(pdev, 1); - printk(KERN_DEBUG PFX "Memaddr0 is %x, length is %x\n", mem_addr0, mem_len0); - printk(KERN_DEBUG PFX "Memaddr1 is %x, length is %x\n", mem_addr1, mem_len1); - err = pci_request_regions(pdev, "agnx-pci"); if (err) { - printk(KERN_ERR PFX "Can't obtain PCI resource\n"); + dev_err(&pdev->dev, "can't reserve PCI resources\n"); return err; } if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) || pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32))) { - printk(KERN_ERR PFX "No suitable DMA available\n"); + dev_err(&pdev->dev, "no suitable DMA available\n"); + err = -EIO; goto err_free_reg; } pci_set_master(pdev); - printk(KERN_DEBUG PFX "pdev->irq is %d\n", pdev->irq); dev = ieee80211_alloc_hw(sizeof(*priv), &agnx_ops); if (!dev) { - printk(KERN_ERR PFX "ieee80211 alloc failed\n"); + dev_err(&pdev->dev, "ieee80211 alloc failed\n"); err = -ENOMEM; goto err_free_reg; } - /* init priv */ priv = dev->priv; memset(priv, 0, sizeof(*priv)); priv->mode = NL80211_IFTYPE_MONITOR; @@ -501,17 +493,17 @@ static int __devinit agnx_pci_probe(struct pci_dev *pdev, spin_lock_init(&priv->lock); priv->init_status = AGNX_UNINIT; - /* Map mem #1 and #2 */ - priv->ctl = pci_iomap(pdev, 0, mem_len0); -/* printk(KERN_DEBUG PFX"MEM1 mapped address is 0x%p\n", priv->ctl); */ + priv->ctl = pci_iomap(pdev, 0, 0); +/* dev_dbg(&pdev->dev, "MEM1 mapped address is 0x%p\n", priv->ctl); */ if (!priv->ctl) { - printk(KERN_ERR PFX "Can't map device memory\n"); + dev_err(&pdev->dev, "can't map device memory\n"); + err = -ENOMEM; goto err_free_dev; } - priv->data = pci_iomap(pdev, 1, mem_len1); - printk(KERN_DEBUG PFX "MEM2 mapped address is 0x%p\n", priv->data); + priv->data = pci_iomap(pdev, 1, 0); if (!priv->data) { - printk(KERN_ERR PFX "Can't map device memory\n"); + dev_err(&pdev->dev, "can't map device memory\n"); + err = -ENOMEM; goto err_iounmap2; } @@ -552,15 +544,15 @@ static int __devinit agnx_pci_probe(struct pci_dev *pdev, err = ieee80211_register_hw(dev); if (err) { - printk(KERN_ERR PFX "Can't register hardware\n"); + dev_err(&pdev->dev, "can't register hardware\n"); goto err_iounmap; } agnx_hw_reset(priv); - - printk(PFX "%s: hwaddr %s, Rev 0x%02x\n", wiphy_name(dev->wiphy), - print_mac(mac, dev->wiphy->perm_addr), priv->revid); + dev_info(&pdev->dev, "%s: hwaddr %pM, Rev 0x%02x\n", + wiphy_name(dev->wiphy), + dev->wiphy->perm_addr, priv->revid); return 0; err_iounmap: diff --git a/drivers/staging/agnx/phy.c b/drivers/staging/agnx/phy.c index 2be63312b727..ec1ca86fa0c4 100644 --- a/drivers/staging/agnx/phy.c +++ b/drivers/staging/agnx/phy.c @@ -118,7 +118,7 @@ static void mac_address_set(struct agnx_priv *priv) iowrite32(reg, ctl + AGNX_RXM_MACLO); } -static void receiver_bssid_set(struct agnx_priv *priv, u8 *bssid) +static void receiver_bssid_set(struct agnx_priv *priv, const u8 *bssid) { void __iomem *ctl = priv->ctl; u32 reg; @@ -954,7 +954,7 @@ int agnx_set_ssid(struct agnx_priv *priv, u8 *ssid, size_t ssid_len) return 0; } -void agnx_set_bssid(struct agnx_priv *priv, u8 *bssid) +void agnx_set_bssid(struct agnx_priv *priv, const u8 *bssid) { receiver_bssid_set(priv, bssid); } diff --git a/drivers/staging/agnx/phy.h b/drivers/staging/agnx/phy.h index 55e1e222179e..a955f05361e7 100644 --- a/drivers/staging/agnx/phy.h +++ b/drivers/staging/agnx/phy.h @@ -401,7 +401,7 @@ u8 read_from_eeprom(struct agnx_priv *priv, u16 address); void agnx_hw_init(struct agnx_priv *priv); int agnx_hw_reset(struct agnx_priv *priv); int agnx_set_ssid(struct agnx_priv *priv, u8 *ssid, size_t ssid_len); -void agnx_set_bssid(struct agnx_priv *priv, u8 *bssid); +void agnx_set_bssid(struct agnx_priv *priv, const u8 *bssid); void enable_power_saving(struct agnx_priv *priv); void disable_power_saving(struct agnx_priv *priv); void calibrate_antenna_period(unsigned long data); diff --git a/drivers/staging/agnx/sta.c b/drivers/staging/agnx/sta.c index 5b2d54a587c8..3e7db5e2811a 100644 --- a/drivers/staging/agnx/sta.c +++ b/drivers/staging/agnx/sta.c @@ -22,7 +22,7 @@ void hash_read(struct agnx_priv *priv, u32 reghi, u32 reglo, u8 sta_id) printk(PFX "RX hash cmd are : %.8x%.8x\n", reghi, reglo); } -void hash_write(struct agnx_priv *priv, u8 *mac_addr, u8 sta_id) +void hash_write(struct agnx_priv *priv, const u8 *mac_addr, u8 sta_id) { void __iomem *ctl = priv->ctl; u32 reghi, reglo; diff --git a/drivers/staging/agnx/sta.h b/drivers/staging/agnx/sta.h index 94e2cf1f973f..fd504e3f3870 100644 --- a/drivers/staging/agnx/sta.h +++ b/drivers/staging/agnx/sta.h @@ -201,7 +201,7 @@ struct agnx_beacon_hdr { /* 802.11(abg) beacon */ } __attribute__((__packed__)); -void hash_write(struct agnx_priv *priv, u8 *mac_addr, u8 sta_id); +void hash_write(struct agnx_priv *priv, const u8 *mac_addr, u8 sta_id); void hash_dump(struct agnx_priv *priv, u8 sta_id); void hash_read(struct agnx_priv *priv, u32 reghi, u32 reglo, u8 sta_id); void hash_delete(struct agnx_priv *priv, u32 reghi, u32 reglo, u8 sta_id); |