2 /******************************************************************************/
4 /* Broadcom BCM5700 Linux Network Driver, Copyright (c) 2000 Broadcom */
6 /* All rights reserved. */
8 /* This program is free software; you can redistribute it and/or modify */
9 /* it under the terms of the GNU General Public License as published by */
10 /* the Free Software Foundation, located in the file LICENSE. */
12 /******************************************************************************/
17 #define __raw_readl readl
18 #define __raw_writel writel
20 #define BIG_ENDIAN_HOST 1
21 #define readl(addr) (*(volatile unsigned int*)(addr))
22 #define writel(b,addr) ((*(volatile unsigned int *) (addr)) = (b))
24 /* Define memory barrier function here if needed */
28 #include <asm/types.h>
29 #include "bcm570x_lm.h"
30 #include "bcm570x_queue.h"
44 extern int MM_Packet_Desc_Size
;
46 #define MM_PACKET_DESC_SIZE MM_Packet_Desc_Size
48 DECLARE_QUEUE_TYPE (UM_RX_PACKET_Q
, MAX_RX_PACKET_DESC_COUNT
+ 1);
54 typedef int spinlock_t
;
56 /* Embedded device control */
57 typedef struct _UM_DEVICE_BLOCK
{
58 LM_DEVICE_BLOCK lm_dev
;
61 void *mem_list
[MAX_MEM
];
62 dma_addr_t dma_list
[MAX_MEM
];
63 int mem_size_list
[MAX_MEM
];
68 int delayed_link_ind
; /* Delay link status during initial load */
69 int adapter_just_inited
; /* the first few seconds after init. */
70 int spurious_int
; /* new -- unsupported */
73 int crc_counter_expiry
; /* new -- unsupported */
74 int poll_tib_expiry
; /* new -- unsupported */
77 int line_speed
; /* in Mbps, 0 if link is down */
78 UM_RX_PACKET_Q rx_out_of_buf_q
;
80 int rx_low_buf_thresh
; /* changed to rx_buf_repl_thresh */
81 int rx_buf_repl_panic_thresh
;
82 int rx_buf_align
; /* new -- unsupported */
87 volatile int interrupt
;
89 int tasklet_busy
; /* new -- unsupported */
92 #ifdef NICE_SUPPORT /* unsupported, this is a linux ioctl */
93 void (*nice_rx
) (void *, void *);
95 #endif /* NICE_SUPPORT */
96 int rx_adaptive_coalesce
;
97 unsigned int rx_last_cnt
;
98 unsigned int tx_last_cnt
;
99 unsigned int rx_curr_coalesce_frames
;
100 unsigned int rx_curr_coalesce_ticks
;
101 unsigned int tx_curr_coalesce_frames
; /* new -- unsupported */
102 #if TIGON3_DEBUG /* new -- unsupported */
104 uint tx_chksum_count
;
106 uint rx_good_chksum_count
;
108 unsigned int rx_bad_chksum_count
; /* new -- unsupported */
109 unsigned int rx_misc_errors
; /* new -- unsupported */
110 } UM_DEVICE_BLOCK
, *PUM_DEVICE_BLOCK
;
112 /* Physical/PCI DMA address */
121 void *skbuff
; /* Address of packet buffer */
122 } UM_PACKET
, *PUM_PACKET
;
124 #define MM_ACQUIRE_UNDI_LOCK(_pDevice)
125 #define MM_RELEASE_UNDI_LOCK(_pDevice)
126 #define MM_ACQUIRE_INT_LOCK(_pDevice)
127 #define MM_RELEASE_INT_LOCK(_pDevice)
128 #define MM_UINT_PTR(_ptr) ((unsigned long) (_ptr))
130 /* Macro for setting 64bit address struct */
131 #define set_64bit_addr(paddr, low, high) \
132 (paddr)->Low = low; \
133 (paddr)->High = high;
135 /* Assume that PCI controller's view of host memory is same as host */
137 #define MEM_TO_PCI_PHYS(addr) (addr)
139 extern void MM_SetAddr (LM_PHYSICAL_ADDRESS
* paddr
, dma_addr_t addr
);
140 extern void MM_SetT3Addr (T3_64BIT_HOST_ADDR
* paddr
, dma_addr_t addr
);
141 extern void MM_MapTxDma (PLM_DEVICE_BLOCK pDevice
,
142 struct _LM_PACKET
*pPacket
, T3_64BIT_HOST_ADDR
* paddr
,
143 LM_UINT32
* len
, int frag
);
144 extern void MM_MapRxDma (PLM_DEVICE_BLOCK pDevice
,
145 struct _LM_PACKET
*pPacket
,
146 T3_64BIT_HOST_ADDR
* paddr
);
148 /* BSP needs to provide sysUsecDelay and sysSerialPrintString */
149 extern void sysSerialPrintString (char *s
);
150 #define MM_Wait(usec) udelay(usec)
152 /* Define memory barrier function here if needed */
156 #define cpu_to_le32(val) LONGSWAP(val)