Lines Matching refs:rt2x00dev

36 static void rt2x00pci_free_reg(struct rt2x00_dev *rt2x00dev)  in rt2x00pci_free_reg()  argument
38 kfree(rt2x00dev->rf); in rt2x00pci_free_reg()
39 rt2x00dev->rf = NULL; in rt2x00pci_free_reg()
41 kfree(rt2x00dev->eeprom); in rt2x00pci_free_reg()
42 rt2x00dev->eeprom = NULL; in rt2x00pci_free_reg()
44 if (rt2x00dev->csr.base) { in rt2x00pci_free_reg()
45 iounmap(rt2x00dev->csr.base); in rt2x00pci_free_reg()
46 rt2x00dev->csr.base = NULL; in rt2x00pci_free_reg()
50 static int rt2x00pci_alloc_reg(struct rt2x00_dev *rt2x00dev) in rt2x00pci_alloc_reg() argument
52 struct pci_dev *pci_dev = to_pci_dev(rt2x00dev->dev); in rt2x00pci_alloc_reg()
54 rt2x00dev->csr.base = pci_ioremap_bar(pci_dev, 0); in rt2x00pci_alloc_reg()
55 if (!rt2x00dev->csr.base) in rt2x00pci_alloc_reg()
58 rt2x00dev->eeprom = kzalloc(rt2x00dev->ops->eeprom_size, GFP_KERNEL); in rt2x00pci_alloc_reg()
59 if (!rt2x00dev->eeprom) in rt2x00pci_alloc_reg()
62 rt2x00dev->rf = kzalloc(rt2x00dev->ops->rf_size, GFP_KERNEL); in rt2x00pci_alloc_reg()
63 if (!rt2x00dev->rf) in rt2x00pci_alloc_reg()
71 rt2x00pci_free_reg(rt2x00dev); in rt2x00pci_alloc_reg()
79 struct rt2x00_dev *rt2x00dev; in rt2x00pci_probe() local
115 rt2x00dev = hw->priv; in rt2x00pci_probe()
116 rt2x00dev->dev = &pci_dev->dev; in rt2x00pci_probe()
117 rt2x00dev->ops = ops; in rt2x00pci_probe()
118 rt2x00dev->hw = hw; in rt2x00pci_probe()
119 rt2x00dev->irq = pci_dev->irq; in rt2x00pci_probe()
120 rt2x00dev->name = ops->name; in rt2x00pci_probe()
123 rt2x00_set_chip_intf(rt2x00dev, RT2X00_CHIP_INTF_PCIE); in rt2x00pci_probe()
125 rt2x00_set_chip_intf(rt2x00dev, RT2X00_CHIP_INTF_PCI); in rt2x00pci_probe()
127 retval = rt2x00pci_alloc_reg(rt2x00dev); in rt2x00pci_probe()
137 rt2x00dev->chip.rt = chip; in rt2x00pci_probe()
139 retval = rt2x00lib_probe_dev(rt2x00dev); in rt2x00pci_probe()
146 rt2x00pci_free_reg(rt2x00dev); in rt2x00pci_probe()
164 struct rt2x00_dev *rt2x00dev = hw->priv; in rt2x00pci_remove() local
169 rt2x00lib_remove_dev(rt2x00dev); in rt2x00pci_remove()
170 rt2x00pci_free_reg(rt2x00dev); in rt2x00pci_remove()
185 struct rt2x00_dev *rt2x00dev = hw->priv; in rt2x00pci_suspend() local
188 retval = rt2x00lib_suspend(rt2x00dev, state); in rt2x00pci_suspend()
201 struct rt2x00_dev *rt2x00dev = hw->priv; in rt2x00pci_resume() local
205 rt2x00_err(rt2x00dev, "Failed to resume device\n"); in rt2x00pci_resume()
210 return rt2x00lib_resume(rt2x00dev); in rt2x00pci_resume()