iPXE
Macros | Functions | Variables
b44.c File Reference
#include <errno.h>
#include <assert.h>
#include <stdio.h>
#include <unistd.h>
#include <byteswap.h>
#include <ipxe/io.h>
#include <mii.h>
#include <ipxe/iobuf.h>
#include <ipxe/malloc.h>
#include <ipxe/pci.h>
#include <ipxe/netdevice.h>
#include <ipxe/ethernet.h>
#include <ipxe/if_ether.h>
#include "b44.h"

Go to the source code of this file.

Macros

#define VIRT_TO_B44(addr)   ( virt_to_bus(addr) + SB_PCI_DMA )
 
#define CTRL_MASK   (DMARX_CTRL_ENABLE | (RX_PKT_OFFSET << DMARX_CTRL_ROSHIFT))
 

Functions

 FILE_LICENCE (GPL2_OR_LATER)
 
static int ring_next (int index)
 
static u32 br32 (const struct b44_private *bp, u32 reg)
 
static void bw32 (const struct b44_private *bp, u32 reg, u32 val)
 
static void bflush (const struct b44_private *bp, u32 reg, u32 timeout)
 
static int b44_address_ok (void *address)
 Check if card can access address. More...
 
static u32 pending_tx_index (struct b44_private *bp)
 Ring cells waiting to be processed are between 'tx_cur' and 'pending' indexes in the ring. More...
 
static u32 pending_rx_index (struct b44_private *bp)
 Ring cells waiting to be processed are between 'rx_cur' and 'pending' indexes in the ring. More...
 
static int b44_wait_bit (struct b44_private *bp, unsigned long reg, u32 bit, unsigned long timeout, const int clear)
 Wait until the given bit is set/cleared. More...
 
static u32 ssb_get_core_rev (struct b44_private *bp)
 
static int ssb_is_core_up (struct b44_private *bp)
 
static u32 ssb_pci_setup (struct b44_private *bp, u32 cores)
 
static void ssb_core_disable (struct b44_private *bp)
 
static void ssb_core_reset (struct b44_private *bp)
 
static void b44_chip_reset (struct b44_private *bp, int reset_kind)
 
static void b44_halt (struct b44_private *bp)
 called by b44_poll in the error path More...
 
static void b44_init_hw (struct b44_private *bp, int reset_kind)
 
static void b44_populate_rx_descriptor (struct b44_private *bp, u32 idx)
 
static void b44_rx_refill (struct b44_private *bp, u32 pending)
 
static void b44_free_rx_ring (struct b44_private *bp)
 
static int b44_init_rx_ring (struct b44_private *bp)
 
static void b44_free_tx_ring (struct b44_private *bp)
 
static int b44_init_tx_ring (struct b44_private *bp)
 
static int b44_phy_read (struct b44_private *bp, int reg, u32 *val)
 
static int b44_phy_write (struct b44_private *bp, int reg, u32 val)
 
static int b44_phy_reset (struct b44_private *bp)
 
static void b44_cam_write (struct b44_private *bp, unsigned char *data, int index)
 
static void b44_set_mac_addr (struct b44_private *bp)
 
static void b44_read_eeprom (struct b44_private *bp, u8 *data)
 
static void b44_load_mac_and_phy_addr (struct b44_private *bp)
 
static void b44_set_rx_mode (struct net_device *netdev)
 
static int b44_probe (struct pci_device *pci)
 Probe device. More...
 
static void b44_remove (struct pci_device *pci)
 Remove device. More...
 
static void b44_irq (struct net_device *netdev, int enable)
 Enable or disable interrupts. More...
 
static int b44_open (struct net_device *netdev)
 Open network device. More...
 
static void b44_close (struct net_device *netdev)
 Close network device. More...
 
static int b44_transmit (struct net_device *netdev, struct io_buffer *iobuf)
 Transmit packet. More...
 
static void b44_tx_complete (struct b44_private *bp)
 Recycles sent TX descriptors and notifies network stack. More...
 
static void b44_process_rx_packets (struct b44_private *bp)
 
static void b44_poll (struct net_device *netdev)
 Poll for completed and received packets. More...
 

Variables

static struct net_device_operations b44_operations
 
static struct pci_device_id b44_nics []
 
struct pci_driver b44_driver __pci_driver
 

Macro Definition Documentation

◆ VIRT_TO_B44

#define VIRT_TO_B44 (   addr)    ( virt_to_bus(addr) + SB_PCI_DMA )

Definition at line 78 of file b44.c.

◆ CTRL_MASK

#define CTRL_MASK   (DMARX_CTRL_ENABLE | (RX_PKT_OFFSET << DMARX_CTRL_ROSHIFT))

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER  )

◆ ring_next()

static int ring_next ( int  index)
inlinestatic

Definition at line 50 of file b44.c.

51 {
52  /* B44_RING_SIZE is a power of 2 :) */
53  return (index + 1) & (B44_RING_SIZE - 1);
54 }
#define B44_RING_SIZE
Definition: b44.h:398
uint64_t index
Index of the first segment within the content.
Definition: pccrc.h:21

References B44_RING_SIZE, and index.

Referenced by b44_process_rx_packets(), b44_rx_refill(), b44_transmit(), and b44_tx_complete().

◆ br32()

static u32 br32 ( const struct b44_private bp,
u32  reg 
)
inlinestatic

Definition at line 59 of file b44.c.

60 {
61  return readl(bp->regs + reg);
62 }
uint32_t readl(volatile uint32_t *io_addr)
Read 32-bit dword from memory-mapped device.
uint16_t bp
Definition: registers.h:23
static unsigned int unsigned int reg
Definition: intel.h:245

References bp, readl(), and reg.

Referenced by b44_chip_reset(), b44_init_hw(), b44_phy_read(), b44_poll(), b44_set_mac_addr(), b44_set_rx_mode(), b44_wait_bit(), pending_rx_index(), pending_tx_index(), ssb_core_disable(), ssb_core_reset(), ssb_get_core_rev(), ssb_is_core_up(), and ssb_pci_setup().

◆ bw32()

static void bw32 ( const struct b44_private bp,
u32  reg,
u32  val 
)
inlinestatic

Definition at line 65 of file b44.c.

66 {
67  writel(val, bp->regs + reg);
68 }
uint16_t bp
Definition: registers.h:23
void writel(uint32_t data, volatile uint32_t *io_addr)
Write 32-bit dword to memory-mapped device.
static unsigned int unsigned int reg
Definition: intel.h:245
void __asmcall int val
Definition: setjmp.h:28

References bp, reg, val, and writel().

Referenced by b44_cam_write(), b44_chip_reset(), b44_halt(), b44_init_hw(), b44_irq(), b44_phy_read(), b44_phy_write(), b44_poll(), b44_populate_rx_descriptor(), b44_set_mac_addr(), b44_set_rx_mode(), b44_transmit(), ssb_core_disable(), ssb_core_reset(), and ssb_pci_setup().

◆ bflush()

static void bflush ( const struct b44_private bp,
u32  reg,
u32  timeout 
)
inlinestatic

Definition at line 71 of file b44.c.

72 {
73  readl(bp->regs + reg);
74  udelay(timeout);
75 }
uint32_t readl(volatile uint32_t *io_addr)
Read 32-bit dword from memory-mapped device.
uint16_t bp
Definition: registers.h:23
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
Definition: timer.c:60
static unsigned int unsigned int reg
Definition: intel.h:245
void timeout(int)

References bp, readl(), reg, timeout(), and udelay().

Referenced by b44_chip_reset(), b44_halt(), b44_poll(), ssb_core_disable(), and ssb_core_reset().

◆ b44_address_ok()

static int b44_address_ok ( void *  address)
inlinestatic

Check if card can access address.

Parameters
addressVirtual address
address_okCard can access address

Definition at line 88 of file b44.c.

88  {
89 
90  /* Card can address anything with a 30-bit address */
91  if ( ( virt_to_bus ( address ) & ~B44_30BIT_DMA_MASK ) == 0 )
92  return 1;
93 
94  return 0;
95 }
uint64_t address
Base address.
Definition: ena.h:24
static __always_inline unsigned long virt_to_bus(volatile const void *addr)
Convert virtual address to a bus address.
Definition: io.h:183
#define B44_30BIT_DMA_MASK
Definition: b44.h:360

References address, B44_30BIT_DMA_MASK, and virt_to_bus().

Referenced by b44_init_rx_ring(), b44_init_tx_ring(), b44_rx_refill(), and b44_transmit().

◆ pending_tx_index()

static u32 pending_tx_index ( struct b44_private bp)
static

Ring cells waiting to be processed are between 'tx_cur' and 'pending' indexes in the ring.

Definition at line 101 of file b44.c.

102 {
105 
106  pending /= sizeof(struct dma_desc);
107  return pending & (B44_RING_SIZE - 1);
108 }
#define B44_DMATX_STAT
Definition: b44.h:111
#define DMATX_STAT_CDMASK
Definition: b44.h:112
uint16_t bp
Definition: registers.h:23
uint32_t pending
Pending events.
Definition: hyperv.h:12
static u32 br32(const struct b44_private *bp, u32 reg)
Definition: b44.c:59
#define B44_RING_SIZE
Definition: b44.h:398
uint32_t u32
Definition: stdint.h:23
Definition: b44.h:348

References B44_DMATX_STAT, B44_RING_SIZE, bp, br32(), DMATX_STAT_CDMASK, and pending.

Referenced by b44_tx_complete().

◆ pending_rx_index()

static u32 pending_rx_index ( struct b44_private bp)
static

Ring cells waiting to be processed are between 'rx_cur' and 'pending' indexes in the ring.

Definition at line 115 of file b44.c.

116 {
119 
120  pending /= sizeof(struct dma_desc);
121  return pending & (B44_RING_SIZE - 1);
122 }
uint16_t bp
Definition: registers.h:23
uint32_t pending
Pending events.
Definition: hyperv.h:12
#define DMARX_STAT_CDMASK
Definition: b44.h:133
static u32 br32(const struct b44_private *bp, u32 reg)
Definition: b44.c:59
#define B44_RING_SIZE
Definition: b44.h:398
#define B44_DMARX_STAT
Definition: b44.h:132
uint32_t u32
Definition: stdint.h:23
Definition: b44.h:348

References B44_DMARX_STAT, B44_RING_SIZE, bp, br32(), DMARX_STAT_CDMASK, and pending.

Referenced by b44_process_rx_packets().

◆ b44_wait_bit()

static int b44_wait_bit ( struct b44_private bp,
unsigned long  reg,
u32  bit,
unsigned long  timeout,
const int  clear 
)
static

Wait until the given bit is set/cleared.

Definition at line 128 of file b44.c.

130 {
131  unsigned long i;
132 
133  for (i = 0; i < timeout; i++) {
134  u32 val = br32(bp, reg);
135 
136  if (clear && !(val & bit))
137  break;
138 
139  if (!clear && (val & bit))
140  break;
141 
142  udelay(10);
143  }
144  if (i == timeout) {
145  return -ENODEV;
146  }
147  return 0;
148 }
static unsigned int unsigned int bit
Definition: bigint.h:205
uint16_t bp
Definition: registers.h:23
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
Definition: timer.c:60
static u32 br32(const struct b44_private *bp, u32 reg)
Definition: b44.c:59
static unsigned int unsigned int reg
Definition: intel.h:245
#define ENODEV
No such device.
Definition: errno.h:509
void __asmcall int val
Definition: setjmp.h:28
void timeout(int)
uint32_t u32
Definition: stdint.h:23

References bit, bp, br32(), ENODEV, reg, timeout(), udelay(), and val.

Referenced by b44_cam_write(), b44_chip_reset(), b44_phy_read(), b44_phy_write(), and ssb_core_disable().

◆ ssb_get_core_rev()

static u32 ssb_get_core_rev ( struct b44_private bp)
inlinestatic

Definition at line 163 of file b44.c.

164 {
165  return (br32(bp, B44_SBIDHIGH) & SBIDHIGH_RC_MASK);
166 }
uint16_t bp
Definition: registers.h:23
static u32 br32(const struct b44_private *bp, u32 reg)
Definition: b44.c:59
#define SBIDHIGH_RC_MASK
Definition: b44.h:300
#define B44_SBIDHIGH
Definition: b44.h:299

References B44_SBIDHIGH, bp, br32(), and SBIDHIGH_RC_MASK.

Referenced by ssb_pci_setup().

◆ ssb_is_core_up()

static int ssb_is_core_up ( struct b44_private bp)
inlinestatic

Definition at line 169 of file b44.c.

170 {
172  == SBTMSLOW_CLOCK);
173 }
#define SBTMSLOW_CLOCK
Definition: b44.h:288
uint16_t bp
Definition: registers.h:23
#define SSB_CORE_DOWN
Definition: b44.h:413
static u32 br32(const struct b44_private *bp, u32 reg)
Definition: b44.c:59
#define B44_SBTMSLOW
Definition: b44.h:285

References B44_SBTMSLOW, bp, br32(), SBTMSLOW_CLOCK, and SSB_CORE_DOWN.

Referenced by b44_chip_reset().

◆ ssb_pci_setup()

static u32 ssb_pci_setup ( struct b44_private bp,
u32  cores 
)
static

Definition at line 176 of file b44.c.

177 {
178  u32 bar_orig, pci_rev, val;
179 
180  pci_read_config_dword(bp->pci, SSB_BAR0_WIN, &bar_orig);
183  pci_rev = ssb_get_core_rev(bp);
184 
185  val = br32(bp, B44_SBINTVEC);
186  val |= cores;
187  bw32(bp, B44_SBINTVEC, val);
188 
192 
193  pci_write_config_dword(bp->pci, SSB_BAR0_WIN, bar_orig);
194 
195  return pci_rev;
196 }
#define SSB_PCI_TRANS_2
Definition: b44.h:324
#define SSB_BAR0_WIN
Definition: b44.h:309
static u32 ssb_get_core_rev(struct b44_private *bp)
Definition: b44.c:163
uint16_t bp
Definition: registers.h:23
static void bw32(const struct b44_private *bp, u32 reg, u32 val)
Definition: b44.c:65
int pci_read_config_dword(struct pci_device *pci, unsigned int where, uint32_t *value)
Read 32-bit dword from PCI configuration space.
#define SSB_PCI_PREF
Definition: b44.h:331
#define SSB_PCI_BURST
Definition: b44.h:332
static u32 br32(const struct b44_private *bp, u32 reg)
Definition: b44.c:59
#define BCM4400_PCI_CORE_ADDR
Definition: b44.h:392
void __asmcall int val
Definition: setjmp.h:28
int pci_write_config_dword(struct pci_device *pci, unsigned int where, uint32_t value)
Write 32-bit dword to PCI configuration space.
#define B44_SBINTVEC
Definition: b44.h:277
uint32_t u32
Definition: stdint.h:23

References B44_SBINTVEC, BCM4400_PCI_CORE_ADDR, bp, br32(), bw32(), pci_read_config_dword(), pci_write_config_dword(), SSB_BAR0_WIN, ssb_get_core_rev(), SSB_PCI_BURST, SSB_PCI_PREF, SSB_PCI_TRANS_2, and val.

Referenced by b44_chip_reset().

◆ ssb_core_disable()

static void ssb_core_disable ( struct b44_private bp)
static

Definition at line 199 of file b44.c.

200 {
202  return;
203 
207 
209  SSB_CORE_DOWN));
210  bflush(bp, B44_SBTMSLOW, 1);
211 
213  bflush(bp, B44_SBTMSLOW, 1);
214 }
static void bflush(const struct b44_private *bp, u32 reg, u32 timeout)
Definition: b44.c:71
#define SBTMSLOW_CLOCK
Definition: b44.h:288
#define SBTMSLOW_REJECT
Definition: b44.h:287
uint16_t bp
Definition: registers.h:23
#define SBTMSLOW_FGC
Definition: b44.h:289
static void bw32(const struct b44_private *bp, u32 reg, u32 val)
Definition: b44.c:65
#define SSB_CORE_DOWN
Definition: b44.h:413
static u32 br32(const struct b44_private *bp, u32 reg)
Definition: b44.c:59
static int b44_wait_bit(struct b44_private *bp, unsigned long reg, u32 bit, unsigned long timeout, const int clear)
Wait until the given bit is set/cleared.
Definition: b44.c:128
#define B44_SBTMSHIGH
Definition: b44.h:292
#define SBTMSHIGH_BUSY
Definition: b44.h:295
#define SBTMSLOW_RESET
Definition: b44.h:286
#define B44_SBTMSLOW
Definition: b44.h:285

References B44_SBTMSHIGH, B44_SBTMSLOW, b44_wait_bit(), bflush(), bp, br32(), bw32(), SBTMSHIGH_BUSY, SBTMSLOW_CLOCK, SBTMSLOW_FGC, SBTMSLOW_REJECT, SBTMSLOW_RESET, and SSB_CORE_DOWN.

Referenced by b44_remove(), and ssb_core_reset().

◆ ssb_core_reset()

static void ssb_core_reset ( struct b44_private bp)
static

Definition at line 217 of file b44.c.

218 {
219  u32 val;
220  const u32 mask = (SBTMSLOW_CLOCK | SBTMSLOW_FGC | SBTMSLOW_RESET);
221 
223 
224  bw32(bp, B44_SBTMSLOW, mask);
225  bflush(bp, B44_SBTMSLOW, 1);
226 
227  /* Clear SERR if set, this is a hw bug workaround. */
229  bw32(bp, B44_SBTMSHIGH, 0);
230 
231  val = br32(bp, B44_SBIMSTATE);
232  if (val & (SBIMSTATE_BAD)) {
234  }
235 
237  bflush(bp, B44_SBTMSLOW, 1);
238 
240  bflush(bp, B44_SBTMSLOW, 1);
241 }
#define SBTMSHIGH_SERR
Definition: b44.h:293
static void bflush(const struct b44_private *bp, u32 reg, u32 timeout)
Definition: b44.c:71
#define SBTMSLOW_CLOCK
Definition: b44.h:288
uint16_t bp
Definition: registers.h:23
#define SBTMSLOW_FGC
Definition: b44.h:289
static void bw32(const struct b44_private *bp, u32 reg, u32 val)
Definition: b44.c:65
static void ssb_core_disable(struct b44_private *bp)
Definition: b44.c:199
static u32 br32(const struct b44_private *bp, u32 reg)
Definition: b44.c:59
#define B44_SBTMSHIGH
Definition: b44.h:292
#define SBIMSTATE_BAD
Definition: b44.h:276
void __asmcall int val
Definition: setjmp.h:28
#define B44_SBIMSTATE
Definition: b44.h:267
#define SBTMSLOW_RESET
Definition: b44.h:286
#define B44_SBTMSLOW
Definition: b44.h:285
uint32_t u32
Definition: stdint.h:23

References B44_SBIMSTATE, B44_SBTMSHIGH, B44_SBTMSLOW, bflush(), bp, br32(), bw32(), SBIMSTATE_BAD, SBTMSHIGH_SERR, SBTMSLOW_CLOCK, SBTMSLOW_FGC, SBTMSLOW_RESET, ssb_core_disable(), and val.

Referenced by b44_chip_reset().

◆ b44_chip_reset()

static void b44_chip_reset ( struct b44_private bp,
int  reset_kind 
)
static

Definition at line 257 of file b44.c.

258 {
259  if (ssb_is_core_up(bp)) {
260  bw32(bp, B44_RCV_LAZY, 0);
261 
263 
265 
266  bw32(bp, B44_DMATX_CTRL, 0);
267 
268  bp->tx_dirty = bp->tx_cur = 0;
269 
272  100, 0);
273 
274  bw32(bp, B44_DMARX_CTRL, 0);
275 
276  bp->rx_cur = 0;
277  } else {
279  }
280 
282 
283  /* Don't enable PHY if we are only doing a partial reset. */
284  if (reset_kind == B44_CHIP_RESET_PARTIAL)
285  return;
286 
287  /* Make PHY accessible. */
290  bflush(bp, B44_MDIO_CTRL, 1);
291 
292  /* Enable internal or external PHY */
293  if (!(br32(bp, B44_DEVCTRL) & DEVCTRL_IPP)) {
295  bflush(bp, B44_ENET_CTRL, 1);
296  } else {
297  u32 val = br32(bp, B44_DEVCTRL);
298  if (val & DEVCTRL_EPR) {
300  bflush(bp, B44_DEVCTRL, 100);
301  }
302  }
303 }
#define ENET_CTRL_EPSEL
Definition: b44.h:208
static void bflush(const struct b44_private *bp, u32 reg, u32 timeout)
Definition: b44.c:71
#define DMARX_STAT_EMASK
Definition: b44.h:139
#define MDIO_CTRL_PREAMBLE
Definition: b44.h:171
#define DMARX_STAT_SIDLE
Definition: b44.h:137
uint16_t bp
Definition: registers.h:23
#define B44_ENET_CTRL
Definition: b44.h:204
static void bw32(const struct b44_private *bp, u32 reg, u32 val)
Definition: b44.c:65
#define B44_RCV_LAZY
Definition: b44.h:99
static void ssb_core_reset(struct b44_private *bp)
Definition: b44.c:217
#define B44_DMARX_CTRL
Definition: b44.h:126
#define ENET_CTRL_DISABLE
Definition: b44.h:206
static u32 br32(const struct b44_private *bp, u32 reg)
Definition: b44.c:59
#define B44_MDIO_CTRL
Definition: b44.h:169
static int b44_wait_bit(struct b44_private *bp, unsigned long reg, u32 bit, unsigned long timeout, const int clear)
Wait until the given bit is set/cleared.
Definition: b44.c:128
void __asmcall int val
Definition: setjmp.h:28
#define SBINTVEC_ENET0
Definition: b44.h:279
#define B44_DEVCTRL
Definition: b44.h:38
#define B44_DMARX_STAT
Definition: b44.h:132
#define MDIO_CTRL_MAXF_MASK
Definition: b44.h:170
#define DEVCTRL_EPR
Definition: b44.h:42
static u32 ssb_pci_setup(struct b44_private *bp, u32 cores)
Definition: b44.c:176
static int ssb_is_core_up(struct b44_private *bp)
Definition: b44.c:169
#define B44_DMATX_CTRL
Definition: b44.h:103
uint32_t u32
Definition: stdint.h:23
#define DEVCTRL_IPP
Definition: b44.h:41
#define B44_CHIP_RESET_PARTIAL
Definition: b44.h:411

References B44_CHIP_RESET_PARTIAL, B44_DEVCTRL, B44_DMARX_CTRL, B44_DMARX_STAT, B44_DMATX_CTRL, B44_ENET_CTRL, B44_MDIO_CTRL, B44_RCV_LAZY, b44_wait_bit(), bflush(), bp, br32(), bw32(), DEVCTRL_EPR, DEVCTRL_IPP, DMARX_STAT_EMASK, DMARX_STAT_SIDLE, ENET_CTRL_DISABLE, ENET_CTRL_EPSEL, MDIO_CTRL_MAXF_MASK, MDIO_CTRL_PREAMBLE, SBINTVEC_ENET0, ssb_core_reset(), ssb_is_core_up(), ssb_pci_setup(), and val.

Referenced by b44_close(), b44_halt(), b44_init_hw(), and b44_probe().

◆ b44_halt()

static void b44_halt ( struct b44_private bp)
static

called by b44_poll in the error path

Definition at line 309 of file b44.c.

310 {
311  /* disable ints */
312  bw32(bp, B44_IMASK, 0);
313  bflush(bp, B44_IMASK, 1);
314 
315  DBG("b44: powering down PHY\n");
317 
318  /*
319  * Now reset the chip, but without enabling
320  * the MAC&PHY part of it.
321  * This has to be done _after_ we shut down the PHY
322  */
324 }
static void b44_chip_reset(struct b44_private *bp, int reset_kind)
Definition: b44.c:257
static void bflush(const struct b44_private *bp, u32 reg, u32 timeout)
Definition: b44.c:71
uint16_t bp
Definition: registers.h:23
static void bw32(const struct b44_private *bp, u32 reg, u32 val)
Definition: b44.c:65
#define MAC_CTRL_PHY_PDOWN
Definition: b44.h:92
#define B44_MAC_CTRL
Definition: b44.h:90
#define B44_IMASK
Definition: b44.h:80
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
#define B44_CHIP_RESET_PARTIAL
Definition: b44.h:411

References b44_chip_reset(), B44_CHIP_RESET_PARTIAL, B44_IMASK, B44_MAC_CTRL, bflush(), bp, bw32(), DBG, and MAC_CTRL_PHY_PDOWN.

Referenced by b44_poll().

◆ b44_init_hw()

static void b44_init_hw ( struct b44_private bp,
int  reset_kind 
)
static

Definition at line 334 of file b44.c.

335 {
336  u32 val;
337 #define CTRL_MASK (DMARX_CTRL_ENABLE | (RX_PKT_OFFSET << DMARX_CTRL_ROSHIFT))
338 
340  if (reset_kind == B44_FULL_RESET) {
341  b44_phy_reset(bp);
342  }
343 
344  /* Enable CRC32, set proper LED modes and power on PHY */
347 
348  /* This sets the MAC address too. */
349  b44_set_rx_mode(bp->netdev);
350 
351  /* MTU + eth header + possible VLAN tag + struct rx_header */
354 
356  if (reset_kind == B44_PARTIAL_RESET) {
358  } else {
361 
365 
367  }
368 
369  val = br32(bp, B44_ENET_CTRL);
371 #undef CTRL_MASK
372 }
#define B44_DMATX_ADDR
Definition: b44.h:109
static void b44_chip_reset(struct b44_private *bp, int reset_kind)
Definition: b44.c:257
#define B44_MIB_CTRL
Definition: b44.h:216
uint16_t bp
Definition: registers.h:23
#define B44_ENET_CTRL
Definition: b44.h:204
#define B44_RXMAXLEN
Definition: b44.h:167
static void bw32(const struct b44_private *bp, u32 reg, u32 val)
Definition: b44.c:65
#define VIRT_TO_B44(addr)
Definition: b44.c:78
#define B44_FULL_RESET
Definition: b44.h:407
#define B44_RCV_LAZY
Definition: b44.h:99
static void b44_set_rx_mode(struct net_device *netdev)
Definition: b44.c:623
#define ETH_HLEN
Definition: if_ether.h:9
#define MAC_CTRL_PHY_LEDCTRL
Definition: b44.h:94
#define B44_DMARX_CTRL
Definition: b44.h:126
#define B44_MAC_CTRL
Definition: b44.h:90
static int b44_phy_reset(struct b44_private *bp)
Definition: b44.c:535
static u32 br32(const struct b44_private *bp, u32 reg)
Definition: b44.c:59
#define B44_TXMAXLEN
Definition: b44.h:168
#define B44_DMARX_ADDR
Definition: b44.h:130
#define B44_PARTIAL_RESET
Definition: b44.h:409
void __asmcall int val
Definition: setjmp.h:28
#define RX_HEADER_LEN
Definition: b44.h:374
#define B44_CHIP_RESET_FULL
Definition: b44.h:410
#define B44_TX_HIWMARK
Definition: b44.h:214
#define TX_HIWMARK_DEFLT
Definition: b44.h:215
#define B44_DMARX_PTR
Definition: b44.h:131
#define B44_MAX_MTU
Definition: b44.h:396
#define ENET_CTRL_ENABLE
Definition: b44.h:205
#define B44_RX_RING_LEN_BYTES
Definition: b44.h:401
#define MAC_CTRL_CRC32_ENAB
Definition: b44.h:91
#define MIB_CTRL_CLR_ON_READ
Definition: b44.h:217
#define RCV_LAZY_FC_SHIFT
Definition: b44.h:102
#define CTRL_MASK
#define B44_DMATX_CTRL
Definition: b44.h:103
#define DMATX_CTRL_ENABLE
Definition: b44.h:104
uint32_t u32
Definition: stdint.h:23

References b44_chip_reset(), B44_CHIP_RESET_FULL, B44_DMARX_ADDR, B44_DMARX_CTRL, B44_DMARX_PTR, B44_DMATX_ADDR, B44_DMATX_CTRL, B44_ENET_CTRL, B44_FULL_RESET, B44_MAC_CTRL, B44_MAX_MTU, B44_MIB_CTRL, B44_PARTIAL_RESET, b44_phy_reset(), B44_RCV_LAZY, B44_RX_RING_LEN_BYTES, B44_RXMAXLEN, b44_set_rx_mode(), B44_TX_HIWMARK, B44_TXMAXLEN, bp, br32(), bw32(), CTRL_MASK, DMATX_CTRL_ENABLE, ENET_CTRL_ENABLE, ETH_HLEN, MAC_CTRL_CRC32_ENAB, MAC_CTRL_PHY_LEDCTRL, MIB_CTRL_CLR_ON_READ, RCV_LAZY_FC_SHIFT, RX_HEADER_LEN, TX_HIWMARK_DEFLT, val, and VIRT_TO_B44.

Referenced by b44_open(), and b44_poll().

◆ b44_populate_rx_descriptor()

static void b44_populate_rx_descriptor ( struct b44_private bp,
u32  idx 
)
static

Definition at line 378 of file b44.c.

379 {
380  struct rx_header *rh;
381  u32 ctrl, addr;
382 
383  rh = bp->rx_iobuf[idx]->data;
384  rh->len = 0;
385  rh->flags = 0;
387  if (idx == B44_RING_LAST) {
388  ctrl |= DESC_CTRL_EOT;
389  }
390  addr = VIRT_TO_B44(bp->rx_iobuf[idx]->data);
391 
392  bp->rx[idx].ctrl = cpu_to_le32(ctrl);
393  bp->rx[idx].addr = cpu_to_le32(addr);
394  bw32(bp, B44_DMARX_PTR, idx * sizeof(struct dma_desc));
395 }
#define RX_PKT_OFFSET
Definition: b44.h:404
Definition: b44.h:369
uint16_t bp
Definition: registers.h:23
static void bw32(const struct b44_private *bp, u32 reg, u32 val)
Definition: b44.c:65
#define VIRT_TO_B44(addr)
Definition: b44.c:78
#define DESC_CTRL_LEN
Definition: b44.h:362
#define cpu_to_le32(value)
Definition: byteswap.h:107
u32 addr
Definition: sky2.h:8
u16 flags
Definition: b44.h:371
#define DESC_CTRL_EOT
Definition: b44.h:364
u16 len
Definition: b44.h:370
#define B44_DMARX_PTR
Definition: b44.h:131
static unsigned int ctrl
Definition: intel.h:270
#define RX_PKT_BUF_SZ
Definition: b44.h:405
#define B44_RING_LAST
Definition: b44.h:399
uint32_t u32
Definition: stdint.h:23
Definition: b44.h:348

References addr, B44_DMARX_PTR, B44_RING_LAST, bp, bw32(), cpu_to_le32, ctrl, DESC_CTRL_EOT, DESC_CTRL_LEN, rx_header::flags, rx_header::len, RX_PKT_BUF_SZ, RX_PKT_OFFSET, and VIRT_TO_B44.

Referenced by b44_init_rx_ring(), and b44_rx_refill().

◆ b44_rx_refill()

static void b44_rx_refill ( struct b44_private bp,
u32  pending 
)
static

Definition at line 403 of file b44.c.

404 {
405  struct io_buffer *iobuf;
406  u32 i;
407 
408  // skip pending
409  for (i = pending + 1; i != bp->rx_cur; i = ring_next(i)) {
410  if (bp->rx_iobuf[i] != NULL)
411  continue;
412 
413  iobuf = alloc_iob(RX_PKT_BUF_SZ);
414  if (!iobuf) {
415  DBG("Refill rx ring failed!!\n");
416  break;
417  }
418  if (!b44_address_ok(iobuf->data)) {
419  DBG("Refill rx ring bad address!!\n");
420  free_iob(iobuf);
421  break;
422  }
423  bp->rx_iobuf[i] = iobuf;
424 
426  }
427 }
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
Definition: iobuf.c:145
uint16_t bp
Definition: registers.h:23
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
Definition: iobuf.c:128
static int ring_next(int index)
Definition: b44.c:50
uint32_t pending
Pending events.
Definition: hyperv.h:12
void * data
Start of data.
Definition: iobuf.h:44
static int b44_address_ok(void *address)
Check if card can access address.
Definition: b44.c:88
static void b44_populate_rx_descriptor(struct b44_private *bp, u32 idx)
Definition: b44.c:378
#define RX_PKT_BUF_SZ
Definition: b44.h:405
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
uint32_t u32
Definition: stdint.h:23
A persistent I/O buffer.
Definition: iobuf.h:32

References alloc_iob(), b44_address_ok(), b44_populate_rx_descriptor(), bp, io_buffer::data, DBG, free_iob(), NULL, pending, ring_next(), and RX_PKT_BUF_SZ.

Referenced by b44_init_rx_ring(), and b44_process_rx_packets().

◆ b44_free_rx_ring()

static void b44_free_rx_ring ( struct b44_private bp)
static

Definition at line 430 of file b44.c.

431 {
432  u32 i;
433 
434  if (bp->rx) {
435  for (i = 0; i < B44_RING_SIZE; i++) {
436  free_iob(bp->rx_iobuf[i]);
437  bp->rx_iobuf[i] = NULL;
438  }
440  bp->rx = NULL;
441  }
442 }
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
Definition: iobuf.c:145
uint16_t bp
Definition: registers.h:23
#define B44_RING_SIZE
Definition: b44.h:398
#define B44_RX_RING_LEN_BYTES
Definition: b44.h:401
static void free_dma(void *ptr, size_t size)
Free memory allocated with malloc_dma()
Definition: malloc.h:81
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
uint32_t u32
Definition: stdint.h:23

References B44_RING_SIZE, B44_RX_RING_LEN_BYTES, bp, free_dma(), free_iob(), and NULL.

Referenced by b44_close(), and b44_init_rx_ring().

◆ b44_init_rx_ring()

static int b44_init_rx_ring ( struct b44_private bp)
static

Definition at line 445 of file b44.c.

446 {
448 
450  if (!bp->rx)
451  return -ENOMEM;
452  if (!b44_address_ok(bp->rx)) {
454  return -ENOTSUP;
455  }
456 
457  memset(bp->rx_iobuf, 0, sizeof(bp->rx_iobuf));
458 
459  bp->rx_iobuf[0] = alloc_iob(RX_PKT_BUF_SZ);
461  b44_rx_refill(bp, 0);
462 
463  DBG("Init RX rings: rx=0x%08lx\n", VIRT_TO_B44(bp->rx));
464  return 0;
465 }
uint16_t bp
Definition: registers.h:23
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
Definition: iobuf.c:128
#define VIRT_TO_B44(addr)
Definition: b44.c:78
#define ENOTSUP
Operation not supported.
Definition: errno.h:589
#define ENOMEM
Not enough space.
Definition: errno.h:534
static void b44_free_rx_ring(struct b44_private *bp)
Definition: b44.c:430
static void b44_rx_refill(struct b44_private *bp, u32 pending)
Definition: b44.c:403
#define B44_DMA_ALIGNMENT
Definition: b44.h:356
static int b44_address_ok(void *address)
Check if card can access address.
Definition: b44.c:88
static void *__malloc malloc_dma(size_t size, size_t phys_align)
Allocate memory for DMA.
Definition: malloc.h:66
static void b44_populate_rx_descriptor(struct b44_private *bp, u32 idx)
Definition: b44.c:378
#define RX_PKT_BUF_SZ
Definition: b44.h:405
#define B44_RX_RING_LEN_BYTES
Definition: b44.h:401
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
static void free_dma(void *ptr, size_t size)
Free memory allocated with malloc_dma()
Definition: malloc.h:81
void * memset(void *dest, int character, size_t len) __nonnull

References alloc_iob(), b44_address_ok(), B44_DMA_ALIGNMENT, b44_free_rx_ring(), b44_populate_rx_descriptor(), b44_rx_refill(), B44_RX_RING_LEN_BYTES, bp, DBG, ENOMEM, ENOTSUP, free_dma(), malloc_dma(), memset(), RX_PKT_BUF_SZ, and VIRT_TO_B44.

Referenced by b44_open(), and b44_poll().

◆ b44_free_tx_ring()

static void b44_free_tx_ring ( struct b44_private bp)
static

Definition at line 468 of file b44.c.

469 {
470  if (bp->tx) {
472  bp->tx = NULL;
473  }
474 }
uint16_t bp
Definition: registers.h:23
#define B44_TX_RING_LEN_BYTES
Definition: b44.h:402
static void free_dma(void *ptr, size_t size)
Free memory allocated with malloc_dma()
Definition: malloc.h:81
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References B44_TX_RING_LEN_BYTES, bp, free_dma(), and NULL.

Referenced by b44_close(), and b44_init_tx_ring().

◆ b44_init_tx_ring()

static int b44_init_tx_ring ( struct b44_private bp)
static

Definition at line 477 of file b44.c.

478 {
480 
482  if (!bp->tx)
483  return -ENOMEM;
484  if (!b44_address_ok(bp->tx)) {
486  return -ENOTSUP;
487  }
488 
490  memset(bp->tx_iobuf, 0, sizeof(bp->tx_iobuf));
491 
492  DBG("Init TX rings: tx=0x%08lx\n", VIRT_TO_B44(bp->tx));
493  return 0;
494 }
uint16_t bp
Definition: registers.h:23
#define VIRT_TO_B44(addr)
Definition: b44.c:78
#define ENOTSUP
Operation not supported.
Definition: errno.h:589
#define ENOMEM
Not enough space.
Definition: errno.h:534
#define B44_TX_RING_LEN_BYTES
Definition: b44.h:402
#define B44_DMA_ALIGNMENT
Definition: b44.h:356
static void b44_free_tx_ring(struct b44_private *bp)
Definition: b44.c:468
static int b44_address_ok(void *address)
Check if card can access address.
Definition: b44.c:88
static void *__malloc malloc_dma(size_t size, size_t phys_align)
Allocate memory for DMA.
Definition: malloc.h:66
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
static void free_dma(void *ptr, size_t size)
Free memory allocated with malloc_dma()
Definition: malloc.h:81
void * memset(void *dest, int character, size_t len) __nonnull

References b44_address_ok(), B44_DMA_ALIGNMENT, b44_free_tx_ring(), B44_TX_RING_LEN_BYTES, bp, DBG, ENOMEM, ENOTSUP, free_dma(), malloc_dma(), memset(), and VIRT_TO_B44.

Referenced by b44_open(), and b44_poll().

◆ b44_phy_read()

static int b44_phy_read ( struct b44_private bp,
int  reg,
u32 val 
)
static

Definition at line 500 of file b44.c.

501 {
502  int err;
503 
505  u32 arg2 = (bp->phy_addr << MDIO_DATA_PMD_SHIFT);
508  u32 argv = arg1 | arg2 | arg3 | arg4;
509 
512  err = b44_wait_bit(bp, B44_EMAC_ISTAT, EMAC_INT_MII, 100, 0);
514 
515  return err;
516 }
static unsigned int unsigned long unsigned long unsigned long unsigned long arg4
Definition: xen.h:118
#define MDIO_DATA_OP_SHIFT
Definition: b44.h:182
#define B44_EMAC_ISTAT
Definition: b44.h:189
#define MDIO_DATA_RA_SHIFT
Definition: b44.h:178
uint16_t bp
Definition: registers.h:23
static void bw32(const struct b44_private *bp, u32 reg, u32 val)
Definition: b44.c:65
static unsigned int unsigned long arg1
Definition: xen.h:43
#define MDIO_TA_VALID
Definition: b44.h:176
#define MDIO_DATA_DATA
Definition: b44.h:173
#define B44_MDIO_DATA
Definition: b44.h:172
static u32 br32(const struct b44_private *bp, u32 reg)
Definition: b44.c:59
static unsigned int unsigned int reg
Definition: intel.h:245
static int b44_wait_bit(struct b44_private *bp, unsigned long reg, u32 bit, unsigned long timeout, const int clear)
Wait until the given bit is set/cleared.
Definition: b44.c:128
#define MDIO_DATA_SB_START
Definition: b44.h:187
void __asmcall int val
Definition: setjmp.h:28
#define EMAC_INT_MII
Definition: b44.h:190
#define MDIO_DATA_PMD_SHIFT
Definition: b44.h:180
static unsigned int unsigned long unsigned long arg2
Definition: xen.h:66
static unsigned int unsigned long unsigned long unsigned long arg3
Definition: xen.h:90
#define MDIO_OP_READ
Definition: b44.h:184
uint32_t u32
Definition: stdint.h:23
#define MDIO_DATA_TA_SHIFT
Definition: b44.h:175

References arg1, arg2, arg3, arg4, B44_EMAC_ISTAT, B44_MDIO_DATA, b44_wait_bit(), bp, br32(), bw32(), EMAC_INT_MII, MDIO_DATA_DATA, MDIO_DATA_OP_SHIFT, MDIO_DATA_PMD_SHIFT, MDIO_DATA_RA_SHIFT, MDIO_DATA_SB_START, MDIO_DATA_TA_SHIFT, MDIO_OP_READ, MDIO_TA_VALID, reg, and val.

Referenced by b44_phy_reset().

◆ b44_phy_write()

static int b44_phy_write ( struct b44_private bp,
int  reg,
u32  val 
)
static

Definition at line 519 of file b44.c.

520 {
522  u32 arg2 = (bp->phy_addr << MDIO_DATA_PMD_SHIFT);
525  u32 arg5 = (val & MDIO_DATA_DATA);
526  u32 argv = arg1 | arg2 | arg3 | arg4 | arg5;
527 
528 
531  return b44_wait_bit(bp, B44_EMAC_ISTAT, EMAC_INT_MII, 100, 0);
532 }
static unsigned int unsigned long unsigned long unsigned long unsigned long arg4
Definition: xen.h:118
#define MDIO_DATA_OP_SHIFT
Definition: b44.h:182
#define B44_EMAC_ISTAT
Definition: b44.h:189
#define MDIO_DATA_RA_SHIFT
Definition: b44.h:178
uint16_t bp
Definition: registers.h:23
static void bw32(const struct b44_private *bp, u32 reg, u32 val)
Definition: b44.c:65
static unsigned int unsigned long arg1
Definition: xen.h:43
#define MDIO_TA_VALID
Definition: b44.h:176
#define MDIO_DATA_DATA
Definition: b44.h:173
#define B44_MDIO_DATA
Definition: b44.h:172
static unsigned int unsigned int reg
Definition: intel.h:245
static int b44_wait_bit(struct b44_private *bp, unsigned long reg, u32 bit, unsigned long timeout, const int clear)
Wait until the given bit is set/cleared.
Definition: b44.c:128
#define MDIO_OP_WRITE
Definition: b44.h:183
#define MDIO_DATA_SB_START
Definition: b44.h:187
void __asmcall int val
Definition: setjmp.h:28
static unsigned int unsigned long unsigned long unsigned long unsigned long unsigned long arg5
Definition: xen.h:148
#define EMAC_INT_MII
Definition: b44.h:190
#define MDIO_DATA_PMD_SHIFT
Definition: b44.h:180
static unsigned int unsigned long unsigned long arg2
Definition: xen.h:66
static unsigned int unsigned long unsigned long unsigned long arg3
Definition: xen.h:90
uint32_t u32
Definition: stdint.h:23
#define MDIO_DATA_TA_SHIFT
Definition: b44.h:175

References arg1, arg2, arg3, arg4, arg5, B44_EMAC_ISTAT, B44_MDIO_DATA, b44_wait_bit(), bp, bw32(), EMAC_INT_MII, MDIO_DATA_DATA, MDIO_DATA_OP_SHIFT, MDIO_DATA_PMD_SHIFT, MDIO_DATA_RA_SHIFT, MDIO_DATA_SB_START, MDIO_DATA_TA_SHIFT, MDIO_OP_WRITE, MDIO_TA_VALID, reg, and val.

Referenced by b44_phy_reset().

◆ b44_phy_reset()

static int b44_phy_reset ( struct b44_private bp)
static

Definition at line 535 of file b44.c.

536 {
537  u32 val;
538  int err;
539 
541  if (err)
542  return err;
543 
544  udelay(100);
545  err = b44_phy_read(bp, MII_BMCR, &val);
546  if (!err) {
547  if (val & BMCR_RESET) {
548  return -ENODEV;
549  }
550  }
551 
552  return 0;
553 }
uint16_t bp
Definition: registers.h:23
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
Definition: timer.c:60
#define ENODEV
No such device.
Definition: errno.h:509
#define MII_BMCR
Definition: atl1e.h:871
void __asmcall int val
Definition: setjmp.h:28
static int b44_phy_read(struct b44_private *bp, int reg, u32 *val)
Definition: b44.c:500
#define BMCR_RESET
Definition: mii.h:50
static int b44_phy_write(struct b44_private *bp, int reg, u32 val)
Definition: b44.c:519
uint32_t u32
Definition: stdint.h:23

References b44_phy_read(), b44_phy_write(), BMCR_RESET, bp, ENODEV, MII_BMCR, udelay(), and val.

Referenced by b44_init_hw().

◆ b44_cam_write()

static void b44_cam_write ( struct b44_private bp,
unsigned char *  data,
int  index 
)
static

Definition at line 560 of file b44.c.

562 {
563  u32 val;
564 
565  val = ((u32) data[2]) << 24;
566  val |= ((u32) data[3]) << 16;
567  val |= ((u32) data[4]) << 8;
568  val |= ((u32) data[5]) << 0;
570 
571 
573  (((u32) data[0]) << 8) | (((u32) data[1]) << 0));
574 
576 
578  bw32(bp, B44_CAM_CTRL, val);
579 
581 }
#define B44_CAM_DATA_HI
Definition: b44.h:194
#define B44_CAM_CTRL
Definition: b44.h:196
#define CAM_CTRL_INDEX_SHIFT
Definition: b44.h:202
uint16_t bp
Definition: registers.h:23
static void bw32(const struct b44_private *bp, u32 reg, u32 val)
Definition: b44.c:65
#define CAM_CTRL_WRITE
Definition: b44.h:200
#define u32
Definition: vga.h:21
static int b44_wait_bit(struct b44_private *bp, unsigned long reg, u32 bit, unsigned long timeout, const int clear)
Wait until the given bit is set/cleared.
Definition: b44.c:128
void __asmcall int val
Definition: setjmp.h:28
#define CAM_DATA_HI_VALID
Definition: b44.h:195
#define CAM_CTRL_BUSY
Definition: b44.h:203
struct arbelprm_port_state_change_st data
Message.
Definition: arbel.h:12
#define B44_CAM_DATA_LO
Definition: b44.h:193
uint64_t index
Index of the first segment within the content.
Definition: pccrc.h:21
uint32_t u32
Definition: stdint.h:23

References B44_CAM_CTRL, B44_CAM_DATA_HI, B44_CAM_DATA_LO, b44_wait_bit(), bp, bw32(), CAM_CTRL_BUSY, CAM_CTRL_INDEX_SHIFT, CAM_CTRL_WRITE, CAM_DATA_HI_VALID, data, index, u32, and val.

Referenced by b44_set_mac_addr(), and b44_set_rx_mode().

◆ b44_set_mac_addr()

static void b44_set_mac_addr ( struct b44_private bp)
static

Definition at line 584 of file b44.c.

585 {
586  u32 val;
587  bw32(bp, B44_CAM_CTRL, 0);
588  b44_cam_write(bp, bp->netdev->ll_addr, 0);
589  val = br32(bp, B44_CAM_CTRL);
591 }
#define B44_CAM_CTRL
Definition: b44.h:196
uint16_t bp
Definition: registers.h:23
static void bw32(const struct b44_private *bp, u32 reg, u32 val)
Definition: b44.c:65
static void b44_cam_write(struct b44_private *bp, unsigned char *data, int index)
Definition: b44.c:560
static u32 br32(const struct b44_private *bp, u32 reg)
Definition: b44.c:59
void __asmcall int val
Definition: setjmp.h:28
#define CAM_CTRL_ENABLE
Definition: b44.h:197
uint32_t u32
Definition: stdint.h:23

References B44_CAM_CTRL, b44_cam_write(), bp, br32(), bw32(), CAM_CTRL_ENABLE, and val.

Referenced by b44_set_rx_mode().

◆ b44_read_eeprom()

static void b44_read_eeprom ( struct b44_private bp,
u8 data 
)
static

Definition at line 595 of file b44.c.

596 {
597  long i;
598  u16 *ptr = (u16 *) data;
599 
600  for (i = 0; i < 128; i += 2)
601  ptr[i / 2] = cpu_to_le16(readw(bp->regs + 4096 + i));
602 }
uint16_t u16
Definition: stdint.h:21
uint16_t readw(volatile uint16_t *io_addr)
Read 16-bit word from memory-mapped device.
uint16_t bp
Definition: registers.h:23
#define cpu_to_le16(value)
Definition: byteswap.h:106
struct arbelprm_port_state_change_st data
Message.
Definition: arbel.h:12

References bp, cpu_to_le16, data, and readw().

Referenced by b44_load_mac_and_phy_addr().

◆ b44_load_mac_and_phy_addr()

static void b44_load_mac_and_phy_addr ( struct b44_private bp)
static

Definition at line 605 of file b44.c.

606 {
607  u8 eeprom[128];
608 
609  /* Load MAC address, note byteswapping */
610  b44_read_eeprom(bp, &eeprom[0]);
611  bp->netdev->hw_addr[0] = eeprom[79];
612  bp->netdev->hw_addr[1] = eeprom[78];
613  bp->netdev->hw_addr[2] = eeprom[81];
614  bp->netdev->hw_addr[3] = eeprom[80];
615  bp->netdev->hw_addr[4] = eeprom[83];
616  bp->netdev->hw_addr[5] = eeprom[82];
617 
618  /* Load PHY address */
619  bp->phy_addr = eeprom[90] & 0x1f;
620 }
static void b44_read_eeprom(struct b44_private *bp, u8 *data)
Definition: b44.c:595
uint16_t bp
Definition: registers.h:23
eeprom
Definition: 3c90x.h:232
uint8_t u8
Definition: stdint.h:19

References b44_read_eeprom(), and bp.

Referenced by b44_probe().

◆ b44_set_rx_mode()

static void b44_set_rx_mode ( struct net_device netdev)
static

Definition at line 623 of file b44.c.

624 {
625  struct b44_private *bp = netdev_priv(netdev);
626  unsigned char zero[6] = { 0, 0, 0, 0, 0, 0 };
627  u32 val;
628  int i;
629 
630  val = br32(bp, B44_RXCONFIG);
631  val &= ~RXCONFIG_PROMISC;
633 
635 
636  for (i = 1; i < 64; i++)
637  b44_cam_write(bp, zero, i);
638 
639  bw32(bp, B44_RXCONFIG, val);
640  val = br32(bp, B44_CAM_CTRL);
642 }
#define RXCONFIG_PROMISC
Definition: b44.h:162
static void * netdev_priv(struct net_device *netdev)
Get driver private area for this network device.
Definition: netdevice.h:566
#define B44_RXCONFIG
Definition: b44.h:158
#define B44_CAM_CTRL
Definition: b44.h:196
static void b44_set_mac_addr(struct b44_private *bp)
Definition: b44.c:584
uint16_t bp
Definition: registers.h:23
uint32_t zero
Must be zero.
Definition: ntlm.h:24
static void bw32(const struct b44_private *bp, u32 reg, u32 val)
Definition: b44.c:65
#define RXCONFIG_ALLMULTI
Definition: b44.h:160
static struct net_device * netdev
Definition: gdbudp.c:52
static void b44_cam_write(struct b44_private *bp, unsigned char *data, int index)
Definition: b44.c:560
static u32 br32(const struct b44_private *bp, u32 reg)
Definition: b44.c:59
Driver private state.
Definition: b44.h:418
void __asmcall int val
Definition: setjmp.h:28
#define CAM_CTRL_ENABLE
Definition: b44.h:197
uint32_t u32
Definition: stdint.h:23

References B44_CAM_CTRL, b44_cam_write(), B44_RXCONFIG, b44_set_mac_addr(), bp, br32(), bw32(), CAM_CTRL_ENABLE, netdev, netdev_priv(), RXCONFIG_ALLMULTI, RXCONFIG_PROMISC, val, and zero.

Referenced by b44_init_hw().

◆ b44_probe()

static int b44_probe ( struct pci_device pci)
static

Probe device.

Parameters
pciPCI device
idMatching entry in ID table
Return values
rcReturn status code

Definition at line 654 of file b44.c.

655 {
656  struct net_device *netdev;
657  struct b44_private *bp;
658  int rc;
659 
660  /* Set up netdev */
661  netdev = alloc_etherdev(sizeof(*bp));
662  if (!netdev)
663  return -ENOMEM;
664 
667  netdev->dev = &pci->dev;
668 
669  /* Set up private data */
670  bp = netdev_priv(netdev);
671  memset(bp, 0, sizeof(*bp));
672  bp->netdev = netdev;
673  bp->pci = pci;
674 
675  /* Map device registers */
676  bp->regs = ioremap(pci->membase, B44_REGS_SIZE);
677  if (!bp->regs) {
679  return -ENOMEM;
680  }
681 
682  /* Enable PCI bus mastering */
684 
686 
688  if (rc != 0) {
689  iounmap(bp->regs);
691  return rc;
692  }
693 
694  /* Link management currently not implemented */
696 
698 
699  DBG("b44 %s (%04x:%04x) regs=%p MAC=%s\n", pci->id->name,
700  pci->id->vendor, pci->id->device, bp->regs,
702 
703  return 0;
704 }
unsigned long membase
Memory base.
Definition: pci.h:194
static void * netdev_priv(struct net_device *netdev)
Get driver private area for this network device.
Definition: netdevice.h:566
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
static void b44_chip_reset(struct b44_private *bp, int reset_kind)
Definition: b44.c:257
#define B44_REGS_SIZE
Definition: b44.h:415
uint16_t bp
Definition: registers.h:23
static void b44_load_mac_and_phy_addr(struct b44_private *bp)
Definition: b44.c:605
void adjust_pci_device(struct pci_device *pci)
Enable PCI device.
Definition: pci.c:149
struct device dev
Generic device.
Definition: pci.h:189
static void netdev_init(struct net_device *netdev, struct net_device_operations *op)
Initialise a network device.
Definition: netdevice.h:498
static void pci_set_drvdata(struct pci_device *pci, void *priv)
Set PCI driver-private data.
Definition: pci.h:338
#define ENOMEM
Not enough space.
Definition: errno.h:534
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
Definition: netdevice.h:555
static void netdev_link_up(struct net_device *netdev)
Mark network device as having link up.
Definition: netdevice.h:768
static struct net_device * netdev
Definition: gdbudp.c:52
int register_netdev(struct net_device *netdev)
Register network device.
Definition: netdevice.c:667
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
Definition: ethernet.c:175
A network device.
Definition: netdevice.h:348
Driver private state.
Definition: b44.h:418
const char * name
Name.
Definition: pci.h:153
struct device * dev
Underlying hardware device.
Definition: netdevice.h:360
static struct net_device_operations b44_operations
Definition: b44.c:938
#define B44_CHIP_RESET_FULL
Definition: b44.h:410
uint16_t vendor
PCI vendor ID.
Definition: pci.h:155
uint16_t device
PCI device ID.
Definition: pci.h:157
struct net_device * alloc_etherdev(size_t priv_size)
Allocate Ethernet device.
Definition: ethernet.c:264
struct pci_device_id * id
Driver device ID.
Definition: pci.h:220
void iounmap(volatile const void *io_addr)
Unmap I/O address.
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
Definition: netdevice.h:381
struct pci_device * pci
Definition: b44.h:420
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
void * ioremap(unsigned long bus_addr, size_t len)
Map bus address as an I/O address.
void * memset(void *dest, int character, size_t len) __nonnull

References adjust_pci_device(), alloc_etherdev(), b44_chip_reset(), B44_CHIP_RESET_FULL, b44_load_mac_and_phy_addr(), b44_operations, B44_REGS_SIZE, bp, DBG, pci_device::dev, net_device::dev, pci_device_id::device, ENOMEM, eth_ntoa(), pci_device::id, ioremap(), iounmap(), net_device::ll_addr, pci_device::membase, memset(), pci_device_id::name, netdev, netdev_init(), netdev_link_up(), netdev_priv(), netdev_put(), b44_private::pci, pci_set_drvdata(), rc, register_netdev(), and pci_device_id::vendor.

◆ b44_remove()

static void b44_remove ( struct pci_device pci)
static

Remove device.

Parameters
pciPCI device

Definition at line 712 of file b44.c.

713 {
714  struct net_device *netdev = pci_get_drvdata(pci);
715  struct b44_private *bp = netdev_priv(netdev);
716 
719  iounmap(bp->regs);
722 }
static void * netdev_priv(struct net_device *netdev)
Get driver private area for this network device.
Definition: netdevice.h:566
uint16_t bp
Definition: registers.h:23
static void ssb_core_disable(struct b44_private *bp)
Definition: b44.c:199
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
Definition: netdevice.h:555
static struct net_device * netdev
Definition: gdbudp.c:52
void unregister_netdev(struct net_device *netdev)
Unregister network device.
Definition: netdevice.c:844
A network device.
Definition: netdevice.h:348
Driver private state.
Definition: b44.h:418
static void netdev_nullify(struct net_device *netdev)
Stop using a network device.
Definition: netdevice.h:511
static void * pci_get_drvdata(struct pci_device *pci)
Get PCI driver-private data.
Definition: pci.h:348
void iounmap(volatile const void *io_addr)
Unmap I/O address.

References bp, iounmap(), netdev, netdev_nullify(), netdev_priv(), netdev_put(), pci_get_drvdata(), ssb_core_disable(), and unregister_netdev().

◆ b44_irq()

static void b44_irq ( struct net_device netdev,
int  enable 
)
static

Enable or disable interrupts.

Parameters
netdevNetwork device
enableInterrupts should be enabled

Definition at line 730 of file b44.c.

731 {
732  struct b44_private *bp = netdev_priv(netdev);
733 
734  /* Interrupt mask specifies which events generate interrupts */
735  bw32(bp, B44_IMASK, enable ? IMASK_DEF : IMASK_DISABLE);
736 }
static void * netdev_priv(struct net_device *netdev)
Get driver private area for this network device.
Definition: netdevice.h:566
#define IMASK_DISABLE
Definition: b44.h:82
uint16_t bp
Definition: registers.h:23
static void bw32(const struct b44_private *bp, u32 reg, u32 val)
Definition: b44.c:65
static struct net_device * netdev
Definition: gdbudp.c:52
Driver private state.
Definition: b44.h:418
#define IMASK_DEF
Definition: b44.h:81
#define B44_IMASK
Definition: b44.h:80

References B44_IMASK, bp, bw32(), IMASK_DEF, IMASK_DISABLE, netdev, and netdev_priv().

Referenced by b44_open(), and b44_poll().

◆ b44_open()

static int b44_open ( struct net_device netdev)
static

Open network device.

Parameters
netdevNetwork device
Return values
rcReturn status code

Definition at line 744 of file b44.c.

745 {
746  struct b44_private *bp = netdev_priv(netdev);
747  int rc;
748 
750  if (rc != 0)
751  return rc;
752 
754  if (rc != 0)
755  return rc;
756 
758 
759  /* Disable interrupts */
760  b44_irq(netdev, 0);
761 
762  return 0;
763 }
static void * netdev_priv(struct net_device *netdev)
Get driver private area for this network device.
Definition: netdevice.h:566
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
uint16_t bp
Definition: registers.h:23
static void b44_init_hw(struct b44_private *bp, int reset_kind)
Definition: b44.c:334
#define B44_FULL_RESET
Definition: b44.h:407
static struct net_device * netdev
Definition: gdbudp.c:52
static int b44_init_tx_ring(struct b44_private *bp)
Definition: b44.c:477
Driver private state.
Definition: b44.h:418
static int b44_init_rx_ring(struct b44_private *bp)
Definition: b44.c:445
static void b44_irq(struct net_device *netdev, int enable)
Enable or disable interrupts.
Definition: b44.c:730

References B44_FULL_RESET, b44_init_hw(), b44_init_rx_ring(), b44_init_tx_ring(), b44_irq(), bp, netdev, netdev_priv(), and rc.

◆ b44_close()

static void b44_close ( struct net_device netdev)
static

Close network device.

Parameters
netdevNetwork device

Definition at line 770 of file b44.c.

771 {
772  struct b44_private *bp = netdev_priv(netdev);
773 
777 }
static void * netdev_priv(struct net_device *netdev)
Get driver private area for this network device.
Definition: netdevice.h:566
static void b44_chip_reset(struct b44_private *bp, int reset_kind)
Definition: b44.c:257
uint16_t bp
Definition: registers.h:23
#define B44_FULL_RESET
Definition: b44.h:407
static struct net_device * netdev
Definition: gdbudp.c:52
static void b44_free_rx_ring(struct b44_private *bp)
Definition: b44.c:430
Driver private state.
Definition: b44.h:418
static void b44_free_tx_ring(struct b44_private *bp)
Definition: b44.c:468

References b44_chip_reset(), b44_free_rx_ring(), b44_free_tx_ring(), B44_FULL_RESET, bp, netdev, and netdev_priv().

◆ b44_transmit()

static int b44_transmit ( struct net_device netdev,
struct io_buffer iobuf 
)
static

Transmit packet.

Parameters
netdevNetwork device
iobufI/O buffer
Return values
rcReturn status code

Definition at line 786 of file b44.c.

787 {
788  struct b44_private *bp = netdev_priv(netdev);
789  u32 cur = bp->tx_cur;
790  u32 ctrl;
791 
792  /* Check for TX ring overflow */
793  if (bp->tx[cur].ctrl) {
794  DBG("tx overflow\n");
795  return -ENOBUFS;
796  }
797 
798  /* Check for addressability */
799  if (!b44_address_ok(iobuf->data))
800  return -ENOTSUP;
801 
802  /* Will call netdev_tx_complete() on the iobuf later */
803  bp->tx_iobuf[cur] = iobuf;
804 
805  /* Set up TX descriptor */
806  ctrl = (iob_len(iobuf) & DESC_CTRL_LEN) |
808 
809  if (cur == B44_RING_LAST)
810  ctrl |= DESC_CTRL_EOT;
811 
812  bp->tx[cur].ctrl = cpu_to_le32(ctrl);
813  bp->tx[cur].addr = cpu_to_le32(VIRT_TO_B44(iobuf->data));
814 
815  /* Update next available descriptor index */
816  cur = ring_next(cur);
817  bp->tx_cur = cur;
818  wmb();
819 
820  /* Tell card that a new TX descriptor is ready */
821  bw32(bp, B44_DMATX_PTR, cur * sizeof(struct dma_desc));
822  return 0;
823 }
static void * netdev_priv(struct net_device *netdev)
Get driver private area for this network device.
Definition: netdevice.h:566
wmb()
#define B44_DMATX_PTR
Definition: b44.h:110
uint16_t bp
Definition: registers.h:23
static void bw32(const struct b44_private *bp, u32 reg, u32 val)
Definition: b44.c:65
#define VIRT_TO_B44(addr)
Definition: b44.c:78
#define ENOTSUP
Operation not supported.
Definition: errno.h:589
static int ring_next(int index)
Definition: b44.c:50
#define DESC_CTRL_LEN
Definition: b44.h:362
static struct net_device * netdev
Definition: gdbudp.c:52
#define cpu_to_le32(value)
Definition: byteswap.h:107
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
Definition: iobuf.h:151
Driver private state.
Definition: b44.h:418
#define DESC_CTRL_SOF
Definition: b44.h:367
#define DESC_CTRL_EOT
Definition: b44.h:364
static unsigned int ctrl
Definition: intel.h:270
#define ENOBUFS
No buffer space available.
Definition: errno.h:498
void * data
Start of data.
Definition: iobuf.h:44
static int b44_address_ok(void *address)
Check if card can access address.
Definition: b44.c:88
#define DESC_CTRL_IOC
Definition: b44.h:365
#define DESC_CTRL_EOF
Definition: b44.h:366
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
#define B44_RING_LAST
Definition: b44.h:399
uint32_t u32
Definition: stdint.h:23
Definition: b44.h:348

References b44_address_ok(), B44_DMATX_PTR, B44_RING_LAST, bp, bw32(), cpu_to_le32, ctrl, io_buffer::data, DBG, DESC_CTRL_EOF, DESC_CTRL_EOT, DESC_CTRL_IOC, DESC_CTRL_LEN, DESC_CTRL_SOF, ENOBUFS, ENOTSUP, iob_len(), netdev, netdev_priv(), ring_next(), VIRT_TO_B44, and wmb().

◆ b44_tx_complete()

static void b44_tx_complete ( struct b44_private bp)
static

Recycles sent TX descriptors and notifies network stack.

Parameters
bpDriver state

Definition at line 830 of file b44.c.

831 {
832  u32 cur, i;
833 
834  cur = pending_tx_index(bp);
835 
836  for (i = bp->tx_dirty; i != cur; i = ring_next(i)) {
837  /* Free finished frame */
838  netdev_tx_complete(bp->netdev, bp->tx_iobuf[i]);
839  bp->tx_iobuf[i] = NULL;
840 
841  /* Clear TX descriptor */
842  bp->tx[i].ctrl = 0;
843  bp->tx[i].addr = 0;
844  }
845  bp->tx_dirty = cur;
846 }
static void netdev_tx_complete(struct net_device *netdev, struct io_buffer *iobuf)
Complete network transmission.
Definition: netdevice.h:746
static u32 pending_tx_index(struct b44_private *bp)
Ring cells waiting to be processed are between 'tx_cur' and 'pending' indexes in the ring.
Definition: b44.c:101
uint16_t bp
Definition: registers.h:23
static int ring_next(int index)
Definition: b44.c:50
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
uint32_t u32
Definition: stdint.h:23

References bp, netdev_tx_complete(), NULL, pending_tx_index(), and ring_next().

Referenced by b44_poll().

◆ b44_process_rx_packets()

static void b44_process_rx_packets ( struct b44_private bp)
static

Definition at line 849 of file b44.c.

850 {
851  struct io_buffer *iob; /* received data */
852  struct rx_header *rh;
853  u32 pending, i;
854  u16 len;
855 
857 
858  for (i = bp->rx_cur; i != pending; i = ring_next(i)) {
859  iob = bp->rx_iobuf[i];
860  if (iob == NULL)
861  break;
862 
863  rh = iob->data;
864  len = le16_to_cpu(rh->len);
865 
866  /*
867  * Guard against incompletely written RX descriptors.
868  * Without this, things can get really slow!
869  */
870  if (len == 0)
871  break;
872 
873  /* Discard CRC that is generated by the card */
874  len -= 4;
875 
876  /* Check for invalid packets and errors */
877  if (len > RX_PKT_BUF_SZ - RX_PKT_OFFSET ||
878  (rh->flags & cpu_to_le16(RX_FLAG_ERRORS))) {
879  DBG("rx error len=%d flags=%04x\n", len,
880  cpu_to_le16(rh->flags));
881  rh->len = 0;
882  rh->flags = 0;
883  netdev_rx_err(bp->netdev, iob, -EINVAL);
884  continue;
885  }
886 
887  /* Clear RX descriptor */
888  rh->len = 0;
889  rh->flags = 0;
890  bp->rx_iobuf[i] = NULL;
891 
892  /* Hand off the IO buffer to the network stack */
894  iob_put(iob, len);
895  netdev_rx(bp->netdev, iob);
896  }
897  bp->rx_cur = i;
899 }
uint16_t u16
Definition: stdint.h:21
#define EINVAL
Invalid argument.
Definition: errno.h:428
#define iob_put(iobuf, len)
Definition: iobuf.h:116
#define RX_FLAG_ERRORS
Definition: b44.h:385
void netdev_rx_err(struct net_device *netdev, struct io_buffer *iobuf, int rc)
Discard received packet.
Definition: netdevice.c:501
#define RX_PKT_OFFSET
Definition: b44.h:404
Definition: b44.h:369
uint16_t bp
Definition: registers.h:23
static int ring_next(int index)
Definition: b44.c:50
uint32_t pending
Pending events.
Definition: hyperv.h:12
static u32 pending_rx_index(struct b44_private *bp)
Ring cells waiting to be processed are between 'rx_cur' and 'pending' indexes in the ring.
Definition: b44.c:115
static void b44_rx_refill(struct b44_private *bp, u32 pending)
Definition: b44.c:403
#define le16_to_cpu(value)
Definition: byteswap.h:112
void netdev_rx(struct net_device *netdev, struct io_buffer *iobuf)
Add packet to receive queue.
Definition: netdevice.c:470
u16 flags
Definition: b44.h:371
u16 len
Definition: b44.h:370
#define iob_reserve(iobuf, len)
Definition: iobuf.h:63
uint32_t len
Length.
Definition: ena.h:14
void * data
Start of data.
Definition: iobuf.h:44
#define cpu_to_le16(value)
Definition: byteswap.h:106
#define RX_PKT_BUF_SZ
Definition: b44.h:405
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
uint32_t u32
Definition: stdint.h:23
A persistent I/O buffer.
Definition: iobuf.h:32

References b44_rx_refill(), bp, cpu_to_le16, io_buffer::data, DBG, EINVAL, rx_header::flags, iob_put, iob_reserve, le16_to_cpu, len, rx_header::len, netdev_rx(), netdev_rx_err(), NULL, pending, pending_rx_index(), ring_next(), RX_FLAG_ERRORS, RX_PKT_BUF_SZ, and RX_PKT_OFFSET.

Referenced by b44_poll().

◆ b44_poll()

static void b44_poll ( struct net_device netdev)
static

Poll for completed and received packets.

Parameters
netdevNetwork device

Definition at line 906 of file b44.c.

907 {
908  struct b44_private *bp = netdev_priv(netdev);
909  u32 istat;
910 
911  /* Interrupt status */
912  istat = br32(bp, B44_ISTAT);
913  istat &= IMASK_DEF; /* only the events we care about */
914 
915  if (!istat)
916  return;
917  if (istat & ISTAT_TX)
919  if (istat & ISTAT_RX)
921  if (istat & ISTAT_ERRORS) {
922  DBG("b44 error istat=0x%08x\n", istat);
923 
924  /* Reset B44 core partially to avoid long waits */
925  b44_irq(bp->netdev, 0);
926  b44_halt(bp);
930  }
931 
932  /* Acknowledge interrupt */
933  bw32(bp, B44_ISTAT, 0);
934  bflush(bp, B44_ISTAT, 1);
935 }
static void * netdev_priv(struct net_device *netdev)
Get driver private area for this network device.
Definition: netdevice.h:566
static void bflush(const struct b44_private *bp, u32 reg, u32 timeout)
Definition: b44.c:71
#define ISTAT_TX
Definition: b44.h:74
uint16_t bp
Definition: registers.h:23
static void b44_init_hw(struct b44_private *bp, int reset_kind)
Definition: b44.c:334
static void bw32(const struct b44_private *bp, u32 reg, u32 val)
Definition: b44.c:65
static void b44_process_rx_packets(struct b44_private *bp)
Definition: b44.c:849
static struct net_device * netdev
Definition: gdbudp.c:52
static int b44_init_tx_ring(struct b44_private *bp)
Definition: b44.c:477
static void b44_tx_complete(struct b44_private *bp)
Recycles sent TX descriptors and notifies network stack.
Definition: b44.c:830
static u32 br32(const struct b44_private *bp, u32 reg)
Definition: b44.c:59
Driver private state.
Definition: b44.h:418
#define IMASK_DEF
Definition: b44.h:81
static int b44_init_rx_ring(struct b44_private *bp)
Definition: b44.c:445
static void b44_halt(struct b44_private *bp)
called by b44_poll in the error path
Definition: b44.c:309
#define ISTAT_RX
Definition: b44.h:73
#define B44_ISTAT
Definition: b44.h:63
#define ISTAT_ERRORS
Definition: b44.h:78
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
static void b44_irq(struct net_device *netdev, int enable)
Enable or disable interrupts.
Definition: b44.c:730
#define B44_FULL_RESET_SKIP_PHY
Definition: b44.h:408
uint32_t u32
Definition: stdint.h:23

References B44_FULL_RESET_SKIP_PHY, b44_halt(), b44_init_hw(), b44_init_rx_ring(), b44_init_tx_ring(), b44_irq(), B44_ISTAT, b44_process_rx_packets(), b44_tx_complete(), bflush(), bp, br32(), bw32(), DBG, IMASK_DEF, ISTAT_ERRORS, ISTAT_RX, ISTAT_TX, netdev, and netdev_priv().

Variable Documentation

◆ b44_operations

struct net_device_operations b44_operations
static
Initial value:
= {
.open = b44_open,
.close = b44_close,
.transmit = b44_transmit,
.poll = b44_poll,
.irq = b44_irq,
}
static void b44_poll(struct net_device *netdev)
Poll for completed and received packets.
Definition: b44.c:906
static int b44_transmit(struct net_device *netdev, struct io_buffer *iobuf)
Transmit packet.
Definition: b44.c:786
static void b44_close(struct net_device *netdev)
Close network device.
Definition: b44.c:770
static int b44_open(struct net_device *netdev)
Open network device.
Definition: b44.c:744
static void b44_irq(struct net_device *netdev, int enable)
Enable or disable interrupts.
Definition: b44.c:730

Definition at line 938 of file b44.c.

Referenced by b44_probe().

◆ b44_nics

struct pci_device_id b44_nics[]
static
Initial value:
= {
PCI_ROM(0x14e4, 0x4401, "BCM4401", "BCM4401", 0),
PCI_ROM(0x14e4, 0x170c, "BCM4401-B0", "BCM4401-B0", 0),
PCI_ROM(0x14e4, 0x4402, "BCM4401-B1", "BCM4401-B1", 0),
}
#define PCI_ROM(_vendor, _device, _name, _description, _data)
Definition: pci.h:283

Definition at line 947 of file b44.c.

◆ __pci_driver

struct pci_driver b44_driver __pci_driver
Initial value:
= {
.ids = b44_nics,
.id_count = sizeof b44_nics / sizeof b44_nics[0],
.probe = b44_probe,
.remove = b44_remove,
}
static struct pci_device_id b44_nics[]
Definition: b44.c:947
static void b44_remove(struct pci_device *pci)
Remove device.
Definition: b44.c:712
static int b44_probe(struct pci_device *pci)
Probe device.
Definition: b44.c:654

Definition at line 954 of file b44.c.