1 /*************************************
3 **************************************/
7 #define TX_TIMER_PERIOD 10 //10 msec
8 #define MAX_CLASSIFIERS 100
9 //#define MAX_CLASSIFIERS_PER_SF 20
10 #define MAX_TARGET_DSX_BUFFERS 24
12 #define MAX_CNTRL_PKTS 100
13 #define MAX_DATA_PKTS 200
14 #define MAX_ETH_SIZE 1536
15 #define MAX_CNTL_PKT_SIZE 2048
17 #define JIFFIES_2_QUADPART() (ULONG)(jiffies * 10000) // jiffies(1msec) to Quadpart(100nsec)
21 #define MAC_ADDR_REGISTER 0xbf60d000
24 ///////////Quality of Service///////////////////////////
25 #define NO_OF_QUEUES 17
26 #define HiPriority NO_OF_QUEUES-1
33 #define BE_BUCKET_SIZE 1024*1024*100 //32kb
34 #define rtPS_BUCKET_SIZE 1024*1024*100 //8kb
35 #define MAX_ALLOWED_RATE 1024*1024*100
36 #define TX_PACKET_THRESHOLD 10
38 #define DSC_ACTIVATE_REQUEST 248
39 #define QUEUE_DEPTH_OFFSET 0x1fc01000
40 #define MAX_DEVICE_DESC_SIZE 2040
41 #define MAX_CTRL_QUEUE_LEN 100
42 #define MAX_APP_QUEUE_LEN 200
43 #define MAX_LATENCY_ALLOWED 0xFFFFFFFF
44 #define DEFAULT_UG_INTERVAL 250
45 #define DEFAULT_UGI_FACTOR 4
47 #define DEFAULT_PERSFCOUNT 60
48 #define MAX_CONNECTIONS 10
49 #define MAX_CLASS_NAME_LENGTH 32
51 #define ETH_LENGTH_OF_ADDRESS 6
52 #define MAX_MULTICAST_ADDRESSES 32
53 #define IP_LENGTH_OF_ADDRESS 4
55 #define IP_PACKET_ONLY_MODE 0
56 #define ETH_PACKET_TUNNELING_MODE 1
58 ////////////Link Request//////////////
59 #define SET_MAC_ADDRESS_REQUEST 0
60 #define SYNC_UP_REQUEST 1
62 #define LINK_UP_REQUEST 3
63 #define LINK_CONNECTED 4
64 #define SYNC_UP_NOTIFICATION 2
65 #define LINK_UP_NOTIFICATION 4
68 #define LINK_NET_ENTRY 0x0002
69 #define HMC_STATUS 0x0004
70 #define LINK_UP_CONTROL_REQ 0x83
72 #define STATS_POINTER_REQ_STATUS 0x86
73 #define NETWORK_ENTRY_REQ_PAYLOAD 198
74 #define LINK_DOWN_REQ_PAYLOAD 226
75 #define SYNC_UP_REQ_PAYLOAD 228
76 #define STATISTICS_POINTER_REQ 237
77 #define LINK_UP_REQ_PAYLOAD 245
78 #define LINK_UP_ACK 246
80 #define STATS_MSG_SIZE 4
81 #define INDEX_TO_DATA 4
83 #define GO_TO_IDLE_MODE_PAYLOAD 210
84 #define COME_UP_FROM_IDLE_MODE_PAYLOAD 211
85 #define IDLE_MODE_SF_UPDATE_MSG 187
87 #define SKB_RESERVE_ETHERNET_HEADER 16
88 #define SKB_RESERVE_PHS_BYTES 32
90 #define IP_PACKET_ONLY_MODE 0
91 #define ETH_PACKET_TUNNELING_MODE 1
93 #define ETH_CS_802_3 1
94 #define ETH_CS_802_1Q_VLAN 3
97 #define ETH_CS_MASK 0x3f
99 /** \brief Validity bit maps for TLVs in packet classification rule */
101 #define PKT_CLASSIFICATION_USER_PRIORITY_VALID 0
102 #define PKT_CLASSIFICATION_VLANID_VALID 1
105 #define MIN(_a, _b) ((_a) < (_b)? (_a): (_b))
109 /*Leader related terms */
110 #define LEADER_STATUS 0x00
111 #define LEADER_STATUS_TCP_ACK 0x1
112 #define LEADER_SIZE sizeof(LEADER)
113 #define MAC_ADDR_REQ_SIZE sizeof(PACKETTOSEND)
114 #define SS_INFO_REQ_SIZE sizeof(PACKETTOSEND)
115 #define CM_REQUEST_SIZE LEADER_SIZE + sizeof(stLocalSFChangeRequest)
116 #define IDLE_REQ_SIZE sizeof(PACKETTOSEND)
119 #define MAX_TRANSFER_CTRL_BYTE_USB 2 * 1024
121 #define GET_MAILBOX1_REG_REQUEST 0x87
122 #define GET_MAILBOX1_REG_RESPONSE 0x67
123 #define VCID_CONTROL_PACKET 0x00
125 #define TRANSMIT_NETWORK_DATA 0x00
126 #define RECEIVED_NETWORK_DATA 0x20
128 #define CM_RESPONSES 0xA0
129 #define STATUS_RSP 0xA1
130 #define LINK_CONTROL_RESP 0xA2
131 #define IDLE_MODE_STATUS 0xA3
132 #define STATS_POINTER_RESP 0xA6
133 #define MGMT_MSG_INFO_SW_STATUS 0xA7
134 #define AUTH_SS_HOST_MSG 0xA8
136 #define CM_DSA_ACK_PAYLOAD 247
137 #define CM_DSC_ACK_PAYLOAD 248
138 #define CM_DSD_ACK_PAYLOAD 249
139 #define CM_DSDEACTVATE 250
140 #define TOTAL_MASKED_ADDRESS_IN_BYTES 32
144 #define RSSI_INDICATION 2
147 #define STATISTICS_INFO 5
148 #define CM_INDICATION 6
150 #define BUFFER_1K 1024
151 #define BUFFER_2K BUFFER_1K*2
152 #define BUFFER_4K BUFFER_2K*2
153 #define BUFFER_8K BUFFER_4K*2
154 #define BUFFER_16K BUFFER_8K*2
155 #define DOWNLINK_DIR 0
158 #define BCM_SIGNATURE "BECEEM"
161 #define GPIO_OUTPUT_REGISTER 0x0F00003C
162 #define BCM_GPIO_OUTPUT_SET_REG 0x0F000040
163 #define BCM_GPIO_OUTPUT_CLR_REG 0x0F000044
164 #define GPIO_MODE_REGISTER 0x0F000034
165 #define GPIO_PIN_STATE_REGISTER 0x0F000038
168 typedef struct _LINK_STATE
{
172 }LINK_STATE
, *PLINK_STATE
;
177 PHY_SYNC_ACHIVED
= 2,
178 LINKUP_IN_PROGRESS
= 3,
181 LINK_STATUS_RESET_RECIEVED
= 6,
182 PERIODIC_WAKE_UP_NOTIFICATION_FRM_FW
= 7,
183 LINK_SHUTDOWN_REQ_FROM_FIRMWARE
= 8,
184 COMPLETE_WAKE_UP_NOTIFICATION_FRM_FW
=9
187 typedef enum _E_PHS_DSC_ACTION
196 #define CM_CONTROL_NEWDSX_MULTICLASSIFIER_REQ 0x89 // Host to Mac
197 #define CM_CONTROL_NEWDSX_MULTICLASSIFIER_RESP 0xA9 // Mac to Host
198 #define MASK_DISABLE_HEADER_SUPPRESSION 0x10 //0b000010000
199 #define MINIMUM_PENDING_DESCRIPTORS 5
201 #define SHUTDOWN_HOSTINITIATED_REQUESTPAYLOAD 0xCC
202 #define SHUTDOWN_ACK_FROM_DRIVER 0x1
203 #define SHUTDOWN_NACK_FROM_DRIVER 0x2
205 #define LINK_SYNC_UP_SUBTYPE 0x0001
206 #define LINK_SYNC_DOWN_SUBTYPE 0x0001
211 #define SINGLE_DESCRIPTOR 1
214 #define DESCRIPTOR_LENGTH 0x30
215 #define FIRMWARE_DESCS_ADDRESS 0x1F100000
218 #define CLOCK_RESET_CNTRL_REG_1 0x0F00000C
219 #define CLOCK_RESET_CNTRL_REG_2 0x0F000840
223 #define TX_DESCRIPTOR_HEAD_REGISTER 0x0F010034
224 #define RX_DESCRIPTOR_HEAD_REGISTER 0x0F010094
226 #define STATISTICS_BEGIN_ADDR 0xbf60f02c
228 #define MAX_PENDING_CTRL_PACKET (MAX_CTRL_QUEUE_LEN-10)
230 #define WIMAX_MAX_MTU (MTU_SIZE + ETH_HLEN)
231 #define AUTO_LINKUP_ENABLE 0x2
232 #define AUTO_SYNC_DISABLE 0x1
233 #define AUTO_FIRM_DOWNLOAD 0x1
234 #define SETTLE_DOWN_TIME 50
236 #define HOST_BUS_SUSPEND_BIT 16
238 #define IDLE_MESSAGE 0x81
240 #define MIPS_CLOCK_133MHz 1
242 #define TARGET_CAN_GO_TO_IDLE_MODE 2
243 #define TARGET_CAN_NOT_GO_TO_IDLE_MODE 3
244 #define IDLE_MODE_PAYLOAD_LENGTH 8
246 #define IP_HEADER(Buffer) ((IPHeaderFormat*)(Buffer))
248 #define IP_VERSION(byte) (((byte&0xF0)>>4))
250 #define SET_MAC_ADDRESS 193
251 #define SET_MAC_ADDRESS_RESPONSE 236
253 #define IDLE_MODE_WAKEUP_PATTERN 0xd0ea1d1e
254 #define IDLE_MODE_WAKEUP_NOTIFIER_ADDRESS 0x1FC02FA8
255 #define IDLE_MODE_MAX_RETRY_COUNT 1000
258 #define CONFIG_BEGIN_ADDR 0xBF60B004
260 #define CONFIG_BEGIN_ADDR 0xBF60B000
263 #define FIRMWARE_BEGIN_ADDR 0xBFC00000
265 #define INVALID_QUEUE_INDEX (USHORT)-1
267 #define INVALID_PID (pid_t)-1
269 #define DDR_100_MHZ 1
270 #define DDR_120_MHZ 2 // Additional Frequency for T3LP
271 #define DDR_133_MHZ 3
272 #define DDR_140_MHZ 4 // Not Used (Reserved for future)
273 #define DDR_160_MHZ 5 // Additional Frequency for T3LP
274 #define DDR_180_MHZ 6 // Not Used (Reserved for future)
275 #define DDR_200_MHZ 7 // Not Used (Reserved for future)
277 #define MIPS_200_MHZ 0
278 #define MIPS_160_MHZ 1
280 #define PLL_800_MHZ 0
281 #define PLL_266_MHZ 1
283 #define DEVICE_POWERSAVE_MODE_AS_MANUAL_CLOCK_GATING 0
284 #define DEVICE_POWERSAVE_MODE_AS_PMU_CLOCK_GATING 1
285 #define DEVICE_POWERSAVE_MODE_AS_PMU_SHUTDOWN 2
286 #define DEVICE_POWERSAVE_MODE_AS_RESERVED 3
287 #define DEVICE_POWERSAVE_MODE_AS_PROTOCOL_IDLE_MODE 4
290 #define EEPROM_REJECT_REG_1 0x0f003018
291 #define EEPROM_REJECT_REG_2 0x0f00301c
292 #define EEPROM_REJECT_REG_3 0x0f003008
293 #define EEPROM_REJECT_REG_4 0x0f003020
294 #define EEPROM_REJECT_MASK 0x0fffffff
297 /* Idle Mode Related Registers */
298 #define DEBUG_INTERRUPT_GENERATOR_REGISTOR 0x0F00007C
299 #define SW_ABORT_IDLEMODE_LOC 0x0FF01FFC
301 #define SW_ABORT_IDLEMODE_PATTERN 0xd0ea1d1e
302 #define DEVICE_INT_OUT_EP_REG0 0x0F011870
303 #define DEVICE_INT_OUT_EP_REG1 0x0F011874
305 #define BIN_FILE "/lib/firmware/macxvi200.bin"
306 #define CFG_FILE "/lib/firmware/macxvi.cfg"
307 #define SF_MAX_ALLOWED_PACKETS_TO_BACKUP 128
308 #define MIN_VAL(x,y) ((x)<(y)?(x):(y))
309 #define MAC_ADDRESS_SIZE 6
310 #define EEPROM_COMMAND_Q_REG 0x0F003018
311 #define EEPROM_READ_DATA_Q_REG 0x0F003020
312 #define CHIP_ID_REG 0x0F000000
313 #define GPIO_MODE_REG 0x0F000034
314 #define GPIO_OUTPUT_REG 0x0F00003C
315 #define WIMAX_MAX_ALLOWED_RATE 1024*1024*50
317 #define T3 0xbece0300
318 #define TARGET_SFID_TXDESC_MAP_LOC 0xBFFFF400
323 #define T3LPB 0xbece3300
324 #define BCS220_2 0xbece3311
325 #define BCS220_2BC 0xBECE3310
326 #define BCS250_BC 0xbece3301
327 #define BCS220_3 0xbece3321
330 #define HPM_CONFIG_LDO145 0x0F000D54
331 #define HPM_CONFIG_MSW 0x0F000D58
333 #define T3B 0xbece0310
334 typedef enum eNVM_TYPE
342 typedef enum ePMU_MODES
349 #define MAX_RDM_WRM_RETIRES 1
352 ABORT_SHUTDOWN_MODE
= 1,
355 ABORT_IDLE_SYNCDOWN
= 3
358 #define GET_BCM_ADAPTER(net_dev) (net_dev ? netdev_priv(net_dev) : NULL)
360 /* Offsets used by driver in skb cb variable */
361 #define SKB_CB_CLASSIFICATION_OFFSET 0
362 #define SKB_CB_LATENCY_OFFSET 1
363 #define SKB_CB_TCPACK_OFFSET 2
365 #endif //__MACROS_H__