Definition at line 99 of file ath9k.c.
100{
101 void *mem;
107 int ret = 0;
108 char hw_name[64];
109
111
112
113
114
115
117 if (csz == 0) {
118
119
120
121
122
123
124
125 csz =16;
127 }
128
129
130
131
132
134
135
136
137
138
140 if ((
val & 0x0000ff00) != 0)
142
144 if (!mem) {
145 DBG(
"ath9K: PCI memory map error\n") ;
147 goto err_iomap;
148 }
149
151 if (!dev) {
152 DBG(
"ath9k: No memory for net80211_device\n");
154 goto err_alloc_hw;
155 }
156
159
164
165
167
169
172 if (ret) {
173 DBG(
"ath9k: Failed to initialize device\n");
174 goto err_init;
175 }
176
178 DBG(
"ath9k: %s mem=0x%lx, irq=%d\n",
179 hw_name, (
unsigned long)mem, pdev->
irq);
180
181 return 0;
182
183err_init:
185err_alloc_hw:
187err_iomap:
188 return ret;
189}
static const struct ath_bus_ops ath_pci_bus_ops
int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid, const struct ath_bus_ops *bus_ops)
void ath9k_hw_name(struct ath_hw *ah, char *hw_name, size_t len)
#define DBG(...)
Print a debugging message.
struct net80211_device * net80211_alloc(size_t priv_size)
Allocate 802.11 device.
void net80211_free(struct net80211_device *dev)
Free 802.11 device.
#define ENOMEM
Not enough space.
#define EIO
Input/output error.
void iounmap(volatile const void *io_addr)
Unmap I/O address.
int pci_read_config_dword(struct pci_device *pci, unsigned int where, uint32_t *value)
Read 32-bit dword from PCI configuration space.
int pci_read_config_word(struct pci_device *pci, unsigned int where, uint16_t *value)
Read 16-bit word from PCI configuration space.
void * pci_ioremap(struct pci_device *pci, unsigned long bus_addr, size_t len)
Map PCI bus address as an I/O address.
int pci_write_config_dword(struct pci_device *pci, unsigned int where, uint32_t value)
Write 32-bit dword to PCI configuration space.
void adjust_pci_device(struct pci_device *pci)
Enable PCI device.
#define PCI_SUBSYSTEM_ID
PCI subsystem ID.
static void pci_set_drvdata(struct pci_device *pci, void *priv)
Set PCI driver-private data.
#define PCI_LATENCY_TIMER
PCI latency timer.
struct net80211_device * dev
Structure encapsulating the complete state of an 802.11 device.
struct net_device * netdev
The net_device that wraps us.
void * priv
Driver private data.
struct device * dev
Underlying hardware device.
unsigned long membase
Memory base.
uint8_t irq
Interrupt number.
uint16_t device
Device ID.
References adjust_pci_device(), ath9k_hw_name(), ath9k_init_device(), ath_pci_bus_ops, DBG, ath_softc::dev, net_device::dev, pci_device::device, EIO, ENOMEM, iounmap(), ath_softc::irq, pci_device::irq, ath_softc::mem, pci_device::membase, net80211_alloc(), net80211_free(), net80211_device::netdev, PCI_CACHE_LINE_SIZE, pci_ioremap(), PCI_LATENCY_TIMER, pci_read_config_byte(), pci_read_config_dword(), pci_read_config_word(), pci_set_drvdata(), PCI_SUBSYSTEM_ID, pci_write_config_byte(), pci_write_config_dword(), ath_softc::pdev, net80211_device::priv, ath_softc::sc_ah, ath_softc::sc_flags, SC_OP_INVALID, u16, u32, u8, and val.