Skip to content

Commit

Permalink
Symbol fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Brown committed May 3, 2005
1 parent 3c2851e commit c112f12
Show file tree
Hide file tree
Showing 15 changed files with 185 additions and 177 deletions.
16 changes: 10 additions & 6 deletions src/drivers/net/davicom.c
Expand Up @@ -141,13 +141,17 @@ static unsigned long ioaddr;

/* transmit descriptor and buffer */
#define NTXD 2
static struct txdesc txd[NTXD] __attribute__ ((aligned(4)));
static unsigned char txb[BUFLEN] __attribute__ ((aligned(4)));

/* receive descriptor(s) and buffer(s) */
#define NRXD 4
static struct rxdesc rxd[NRXD] __attribute__ ((aligned(4)));
static unsigned char rxb[NRXD * BUFLEN] __attribute__ ((aligned(4)));
struct {
struct txdesc txd[NTXD] __attribute__ ((aligned(4)));
unsigned char txb[BUFLEN] __attribute__ ((aligned(4)));
struct rxdesc rxd[NRXD] __attribute__ ((aligned(4)));
unsigned char rxb[NRXD * BUFLEN] __attribute__ ((aligned(4)));
} davicom_bufs __shared;
#define txd davicom_bufs.txd
#define txb davicom_bufs.txb
#define rxd davicom_bufs.rxd
#define rxb davicom_bufs.rxb
static int rxd_tail;
static int TxPtr;

Expand Down
33 changes: 14 additions & 19 deletions src/drivers/net/dmfe.c
Expand Up @@ -150,7 +150,7 @@ struct rx_desc {
u32 /* struct rx_desc * */ next_rx_desc;
} __attribute__ ((aligned(32)));

struct dmfe_private {
static struct dmfe_private {
u32 chip_id; /* Chip vendor/Device ID */
u32 chip_revision; /* Chip revision */
u32 cr0_data;
Expand Down Expand Up @@ -214,26 +214,21 @@ static u8 SF_mode; /* Special Function: 1:VLAN, 2:RX Flow Control
/**********************************************
* Descriptor Ring and Buffer defination
***********************************************/
/* Define the TX Descriptor */
static struct tx_desc txd[TX_DESC_CNT]
__attribute__ ((aligned(32)));

/* Create a static buffer of size PKT_BUF_SZ for each TX Descriptor.
All descriptors point to a part of this buffer */
static unsigned char txb[TX_BUF_ALLOC * TX_DESC_CNT]
__attribute__ ((aligned(32)));

/* Define the RX Descriptor */
static struct rx_desc rxd[RX_DESC_CNT]
__attribute__ ((aligned(32)));

/* Create a static buffer of size PKT_BUF_SZ for each RX Descriptor.
All descriptors point to a part of this buffer */
static unsigned char rxb[RX_ALLOC_SIZE * RX_DESC_CNT]
__attribute__ ((aligned(32)));
struct {
struct tx_desc txd[TX_DESC_CNT] __attribute__ ((aligned(32)));
unsigned char txb[TX_BUF_ALLOC * TX_DESC_CNT]
__attribute__ ((aligned(32)));
struct rx_desc rxd[RX_DESC_CNT] __attribute__ ((aligned(32)));
unsigned char rxb[RX_ALLOC_SIZE * RX_DESC_CNT]
__attribute__ ((aligned(32)));
} dmfe_bufs __shared;
#define txd dmfe_bufs.txd
#define txb dmfe_bufs.txb
#define rxd dmfe_bufs.rxd
#define rxb dmfe_bufs.rxb

/* NIC specific static variables go here */
long int BASE;
static long int BASE;

static u16 read_srom_word(long ioaddr, int offset);
static void dmfe_init_dm910x(struct nic *nic);
Expand Down
30 changes: 16 additions & 14 deletions src/drivers/net/e1000.c
Expand Up @@ -89,9 +89,12 @@ static struct nic_operations e1000_operations;
static struct pci_driver e1000_driver;

static struct e1000_hw hw;
static char tx_pool[128 + 16];
static char rx_pool[128 + 16];
static char packet[2096];

struct {
char tx_pool[128 + 16];
char rx_pool[128 + 16];
char packet[2096];
} e1000_bufs __shared;

static struct e1000_tx_desc *tx_base;
static struct e1000_rx_desc *rx_base;
Expand Down Expand Up @@ -171,13 +174,13 @@ static void e1000_irq(struct nic *nic, irq_action_t action);

#define E1000_WRITE_FLUSH(a) {uint32_t x; x = E1000_READ_REG(a, STATUS);}

uint32_t
static inline uint32_t
e1000_io_read(struct e1000_hw *hw __unused, uint32_t port)
{
return inl(port);
}

void
static inline void
e1000_io_write(struct e1000_hw *hw __unused, uint32_t port, uint32_t value)
{
outl(value, port);
Expand Down Expand Up @@ -724,11 +727,10 @@ e1000_clear_vfta(struct e1000_hw *hw)
* hw - Struct containing variables accessed by shared code
* offset - offset to write to * value - value to write
*****************************************************************************/
void e1000_write_reg_io(struct e1000_hw *hw, uint32_t offset, uint32_t value){
uint32_t io_addr = hw->io_base;
uint32_t io_data = hw->io_base + 4;
e1000_io_write(hw, io_addr, offset);
e1000_io_write(hw, io_data, value);
static inline void e1000_write_reg_io(struct e1000_hw *hw, uint32_t offset,
uint32_t value){
e1000_io_write(hw, hw->io_base, offset);
e1000_io_write(hw, hw->io_base + 4, value);
}

/******************************************************************************
Expand Down Expand Up @@ -3362,7 +3364,7 @@ static void fill_rx (void)
rd = rx_base + rx_tail;
rx_tail = (rx_tail + 1) % 8;
memset (rd, 0, 16);
rd->buffer_addr = virt_to_bus(&packet);
rd->buffer_addr = virt_to_bus(&e1000_bufs.packet);
E1000_WRITE_REG (&hw, RDT, rx_tail);
}

Expand All @@ -3371,7 +3373,7 @@ static void init_descriptor (void)
unsigned long ptr;
unsigned long tctl;

ptr = virt_to_phys(tx_pool);
ptr = virt_to_phys(e1000_bufs.tx_pool);
if (ptr & 0xf)
ptr = (ptr + 0x10) & (~0xf);

Expand Down Expand Up @@ -3409,7 +3411,7 @@ static void init_descriptor (void)
rx_tail = 0;
/* disable receive */
E1000_WRITE_REG (&hw, RCTL, 0);
ptr = virt_to_phys(rx_pool);
ptr = virt_to_phys(e1000_bufs.rx_pool);
if (ptr & 0xf)
ptr = (ptr + 0x10) & (~0xf);
rx_base = phys_to_virt(ptr);
Expand Down Expand Up @@ -3454,7 +3456,7 @@ e1000_poll (struct nic *nic, int retrieve)
if ( ! retrieve ) return 1;

// printf("recv: packet %! -> %! len=%d \n", packet+6, packet,rd->Length);
memcpy (nic->packet, packet, rd->length);
memcpy (nic->packet, e1000_bufs.packet, rd->length);
nic->packetlen = rd->length;
fill_rx ();

Expand Down
5 changes: 4 additions & 1 deletion src/drivers/net/eepro100.c
Expand Up @@ -262,7 +262,10 @@ static struct nic_operations eepro100_operations;
static struct pci_driver eepro100_driver;

#define RXFD_COUNT 4
static struct RxFD rxfds[RXFD_COUNT];
struct {
struct RxFD rxfds[RXFD_COUNT];
} eepro100_bufs __shared;
#define rxfds eepro100_bufs.rxfds
static unsigned int rxfd = 0;

static int congenb = 0; /* Enable congestion control in the DP83840. */
Expand Down
14 changes: 10 additions & 4 deletions src/drivers/net/epic100.c
Expand Up @@ -86,12 +86,18 @@ static unsigned int cur_rx, cur_tx; /* The next free ring entry */
static unsigned short eeprom[64];
#endif
static signed char phys[4]; /* MII device addresses. */
static struct epic_rx_desc rx_ring[RX_RING_SIZE]
struct {
struct epic_rx_desc rx_ring[RX_RING_SIZE]
__attribute__ ((aligned(4)));
static struct epic_tx_desc tx_ring[TX_RING_SIZE]
struct epic_tx_desc tx_ring[TX_RING_SIZE]
__attribute__ ((aligned(4)));
static unsigned char rx_packet[PKT_BUF_SZ * RX_RING_SIZE];
static unsigned char tx_packet[PKT_BUF_SZ * TX_RING_SIZE];
unsigned char rx_packet[PKT_BUF_SZ * RX_RING_SIZE];
unsigned char tx_packet[PKT_BUF_SZ * TX_RING_SIZE];
} epic100_bufs __shared;
#define rx_ring epic100_bufs.rx_ring
#define tx_ring epic100_bufs.tx_ring
#define rx_packet epic100_bufs.rx_packet
#define tx_packet epic100_bufs.tx_packet

/***********************************************************************/
/* Externally visible functions */
Expand Down
36 changes: 13 additions & 23 deletions src/drivers/net/forcedeth.c
Expand Up @@ -71,7 +71,7 @@ typedef signed int s32;
#define virt_to_le32desc(addr) cpu_to_le32(virt_to_bus(addr))
#define le32desc_to_virt(addr) bus_to_virt(le32_to_cpu(addr))

unsigned long BASE;
static unsigned long BASE;
/* NIC specific static variables go here */


Expand Down Expand Up @@ -290,24 +290,20 @@ struct ring_desc {
};


/* Define the TX Descriptor */
static struct ring_desc tx_ring[TX_RING];

/* Create a static buffer of size RX_BUF_SZ for each
TX Descriptor. All descriptors point to a
part of this buffer */
static unsigned char txb[TX_RING * RX_NIC_BUFSIZE];

/* Define the TX Descriptor */
static struct ring_desc rx_ring[RX_RING];

/* Create a static buffer of size RX_BUF_SZ for each
RX Descriptor All descriptors point to a
part of this buffer */
static unsigned char rxb[RX_RING * RX_NIC_BUFSIZE];
/* Define the TX and RX Descriptor and Buffers */
struct {
struct ring_desc tx_ring[TX_RING];
unsigned char txb[TX_RING * RX_NIC_BUFSIZE];
struct ring_desc rx_ring[RX_RING];
unsigned char rxb[RX_RING * RX_NIC_BUFSIZE];
} forcedeth_bufs __shared;
#define tx_ring forcedeth_bufs.tx_ring
#define rx_ring forcedeth_bufs.rx_ring
#define txb forcedeth_bufs.txb
#define rxb forcedeth_bufs.rxb

/* Private Storage for the NIC */
struct forcedeth_private {
static struct forcedeth_private {
/* General data:
* Locking: spin_lock(&np->lock); */
int in_shutdown;
Expand All @@ -322,19 +318,13 @@ struct forcedeth_private {
/* rx specific fields.
* Locking: Within irq hander or disable_irq+spin_lock(&np->lock);
*/
struct ring_desc *rx_ring;
unsigned int cur_rx, refill_rx;
struct sk_buff *rx_skbuff[RX_RING];
u32 rx_dma[RX_RING];
unsigned int rx_buf_sz;

/*
* tx specific fields.
*/
struct ring_desc *tx_ring;
unsigned int next_tx, nic_tx;
struct sk_buff *tx_skbuff[TX_RING];
u32 tx_dma[TX_RING];
u16 tx_flags;
} npx;

Expand Down
16 changes: 7 additions & 9 deletions src/drivers/net/mtd80x.c
Expand Up @@ -368,16 +368,14 @@ enum tx_desc_control_bits {
#define LinkIsUp2 0x00040000

/* Create a static buffer of size PKT_BUF_SZ for each
TX Descriptor. All descriptors point to a
RX and TX Descriptor. All descriptors point to a
part of this buffer */
static u8 txb[PKT_BUF_SZ * TX_RING_SIZE]
__attribute__ ((aligned(8)));

/* Create a static buffer of size PKT_BUF_SZ for each
RX Descriptor All descriptors point to a
part of this buffer */
static u8 rxb[PKT_BUF_SZ * RX_RING_SIZE]
__attribute__ ((aligned(8)));
struct {
u8 txb[PKT_BUF_SZ * TX_RING_SIZE] __attribute__ ((aligned(8)));
u8 rxb[PKT_BUF_SZ * RX_RING_SIZE] __attribute__ ((aligned(8)));
} mtd80x_bufs __shared;
#define txb mtd80x_bufs.txb
#define rxb mtd80x_bufs.rxb

/* The Tulip Rx and Tx buffer descriptors. */
struct mtd_desc
Expand Down
15 changes: 10 additions & 5 deletions src/drivers/net/natsemi.c
Expand Up @@ -205,11 +205,16 @@ static unsigned int tx_config;
longword aligned
*/

static BufferDesc txd __attribute__ ((aligned(4)));
static BufferDesc rxd[NUM_RX_DESC] __attribute__ ((aligned(4)));

static unsigned char txb[TX_BUF_SIZE] __attribute__ ((aligned(4)));
static unsigned char rxb[NUM_RX_DESC * RX_BUF_SIZE] __attribute__ ((aligned(4)));
struct {
BufferDesc txd __attribute__ ((aligned(4)));
BufferDesc rxd[NUM_RX_DESC] __attribute__ ((aligned(4)));
unsigned char txb[TX_BUF_SIZE] __attribute__ ((aligned(4)));
unsigned char rxb[NUM_RX_DESC * RX_BUF_SIZE] __attribute__ ((aligned(4)));
} natsemi_bufs __shared;
#define txd natsemi_bufs.txd
#define rxd natsemi_bufs.rxd
#define txb natsemi_bufs.txb
#define rxb natsemi_bufs.rxb

/* Function Prototypes */

Expand Down
30 changes: 12 additions & 18 deletions src/drivers/net/ns83820.c
Expand Up @@ -393,24 +393,18 @@ struct ns83820_private {
} nsx;
static struct ns83820_private *ns;

/* Define the TX Descriptor */
static struct ring_desc tx_ring[NR_TX_DESC]
__attribute__ ((aligned(8)));

/* Create a static buffer of size REAL_RX_BUF_SIZE for each
TX Descriptor. All descriptors point to a
part of this buffer */
static unsigned char txb[NR_TX_DESC * REAL_RX_BUF_SIZE];

/* Define the TX Descriptor */
static struct ring_desc rx_ring[NR_RX_DESC]
__attribute__ ((aligned(8)));

/* Create a static buffer of size REAL_RX_BUF_SIZE for each
RX Descriptor All descriptors point to a
part of this buffer */
static unsigned char rxb[NR_RX_DESC * REAL_RX_BUF_SIZE]
__attribute__ ((aligned(8)));
/* Define the TX and RX Descriptor and Buffers */
struct {
struct ring_desc tx_ring[NR_TX_DESC] __attribute__ ((aligned(8)));
unsigned char txb[NR_TX_DESC * REAL_RX_BUF_SIZE];
struct ring_desc rx_ring[NR_RX_DESC] __attribute__ ((aligned(8)));
unsigned char rxb[NR_RX_DESC * REAL_RX_BUF_SIZE]
__attribute__ ((aligned(8)));
} ns83820_bufs __shared;
#define tx_ring ns83820_bufs.tx_ring
#define rx_ring ns83820_bufs.rx_ring
#define txb ns83820_bufs.txb
#define rxb ns83820_bufs.rxb

static void phy_intr(struct nic *nic __unused)
{
Expand Down

0 comments on commit c112f12

Please sign in to comment.