1 /***********************************
3 ************************************/
7 #define MAX_FRAGMENTEDIP_CLASSIFICATION_ENTRIES 256
16 }__attribute__((packed
));
17 typedef struct _LEADER LEADER
,*PLEADER
;
23 }__attribute__((packed
));
24 typedef struct _PACKETTOSEND PACKETTOSEND
, *PPACKETTOSEND
;
27 struct _CONTROL_PACKET
31 struct _CONTROL_PACKET
* next
;
32 }__attribute__((packed
));
33 typedef struct _CONTROL_PACKET CONTROL_PACKET
,*PCONTROL_PACKET
;
40 }__attribute__((packed
));
41 typedef struct link_request LINK_REQUEST
, *PLINK_REQUEST
;
44 //classification extension is added
45 typedef struct _ADD_CONNECTION
47 ULONG SrcIpAddressCount
;
48 ULONG SrcIpAddress
[MAX_CONNECTIONS
];
49 ULONG SrcIpMask
[MAX_CONNECTIONS
];
51 ULONG DestIpAddressCount
;
52 ULONG DestIpAddress
[MAX_CONNECTIONS
];
53 ULONG DestIpMask
[MAX_CONNECTIONS
];
63 } ADD_CONNECTION
,*PADD_CONNECTION
;
66 typedef struct _CLASSIFICATION_RULE
69 UCHAR ucIPSrcAddr
[32];
70 UCHAR ucIPDestAddrLen
;
71 UCHAR ucIPDestAddr
[32];
72 UCHAR ucSrcPortRangeLen
;
73 UCHAR ucSrcPortRange
[4];
74 UCHAR ucDestPortRangeLen
;
75 UCHAR ucDestPortRange
[4];
77 } CLASSIFICATION_RULE
,*PCLASSIFICATION_RULE
;
79 typedef struct _CLASSIFICATION_ONLY
87 UCHAR ucDestinationAddress
[16];
88 } CLASSIFICATION_ONLY
, *PCLASSIFICATION_ONLY
;
91 #define MAX_IP_RANGE_LENGTH 4
92 #define MAX_PORT_RANGE 4
93 #define MAX_PROTOCOL_LENGTH 32
94 #define IPV6_ADDRESS_SIZEINBYTES 0x10
96 typedef union _U_IP_ADDRESS
100 ULONG ulIpv4Addr
[MAX_IP_RANGE_LENGTH
];//Source Ip Address Range
101 ULONG ulIpv4Mask
[MAX_IP_RANGE_LENGTH
];//Source Ip Mask Address Range
105 ULONG ulIpv6Addr
[MAX_IP_RANGE_LENGTH
* 4];//Source Ip Address Range
106 ULONG ulIpv6Mask
[MAX_IP_RANGE_LENGTH
* 4];//Source Ip Mask Address Range
111 UCHAR ucIpv4Address
[MAX_IP_RANGE_LENGTH
* IP_LENGTH_OF_ADDRESS
];
112 UCHAR ucIpv4Mask
[MAX_IP_RANGE_LENGTH
* IP_LENGTH_OF_ADDRESS
];
116 UCHAR ucIpv6Address
[MAX_IP_RANGE_LENGTH
* IPV6_ADDRESS_SIZEINBYTES
];
117 UCHAR ucIpv6Mask
[MAX_IP_RANGE_LENGTH
* IPV6_ADDRESS_SIZEINBYTES
];
122 typedef struct _S_HDR_SUPRESSION_CONTEXTINFO
125 UCHAR ucaHdrSupressionInBuf
[MAX_PHS_LENGTHS
]; //Intermediate buffer to accumulate pkt Header for PHS
126 UCHAR ucaHdrSupressionOutBuf
[MAX_PHS_LENGTHS
+ PHSI_LEN
]; //Intermediate buffer containing pkt Header after PHS
128 }S_HDR_SUPRESSION_CONTEXTINFO
;
131 typedef struct _S_CLASSIFIER_RULE
135 B_UINT16 uiClassifierRuleIndex
;
138 B_UINT8 u8ClassifierRulePriority
; //This field detemines the Classifier Priority
139 U_IP_ADDRESS stSrcIpAddress
;
140 UCHAR ucIPSourceAddressLength
;//Ip Source Address Length
142 U_IP_ADDRESS stDestIpAddress
;
143 UCHAR ucIPDestinationAddressLength
;//Ip Destination Address Length
144 UCHAR ucIPTypeOfServiceLength
;//Type of service Length
145 UCHAR ucTosLow
;//Tos Low
146 UCHAR ucTosHigh
;//Tos High
147 UCHAR ucTosMask
;//Tos Mask
149 UCHAR ucProtocolLength
;//protocol Length
150 UCHAR ucProtocol
[MAX_PROTOCOL_LENGTH
];//protocol Length
151 USHORT usSrcPortRangeLo
[MAX_PORT_RANGE
];
152 USHORT usSrcPortRangeHi
[MAX_PORT_RANGE
];
153 UCHAR ucSrcPortRangeLength
;
155 USHORT usDestPortRangeLo
[MAX_PORT_RANGE
];
156 USHORT usDestPortRangeHi
[MAX_PORT_RANGE
];
157 UCHAR ucDestPortRangeLength
;
159 BOOLEAN bProtocolValid
;
161 BOOLEAN bDestIpValid
;
164 //For IPv6 Addressing
166 BOOLEAN bIpv6Protocol
;
169 UCHAR u8AssociatedPHSI
;
171 //Classification fields for ETH CS
172 UCHAR ucEthCSSrcMACLen
;
173 UCHAR au8EThCSSrcMAC
[MAC_ADDRESS_SIZE
];
174 UCHAR au8EThCSSrcMACMask
[MAC_ADDRESS_SIZE
];
175 UCHAR ucEthCSDestMACLen
;
176 UCHAR au8EThCSDestMAC
[MAC_ADDRESS_SIZE
];
177 UCHAR au8EThCSDestMACMask
[MAC_ADDRESS_SIZE
];
178 UCHAR ucEtherTypeLen
;
179 UCHAR au8EthCSEtherType
[NUM_ETHERTYPE_BYTES
];
180 UCHAR usUserPriority
[2];
182 USHORT usValidityBitMap
;
184 //typedef struct _S_CLASSIFIER_RULE S_CLASSIFIER_RULE;
186 typedef struct _S_FRAGMENTED_PACKET_INFO
189 ULONG ulSrcIpAddress
;
190 USHORT usIpIdentification
;
191 S_CLASSIFIER_RULE
*pstMatchedClassifierEntry
;
192 BOOLEAN bOutOfOrderFragment
;
193 }S_FRAGMENTED_PACKET_INFO
,*PS_FRAGMENTED_PACKET_INFO
;
197 //classification extension Rule
201 // This field determines the priority of the SF Queues
202 B_UINT8 u8TrafficPriority
;
206 BOOLEAN bActivateRequestSent
;
208 B_UINT8 u8QueueType
;//BE or rtPS
210 UINT uiMaxBucketSize
;//maximum size of the bucket for the queue
211 UINT uiCurrentQueueDepthOnTarget
;
212 UINT uiCurrentBytesOnHost
;
213 UINT uiCurrentPacketsOnHost
;
214 UINT uiDroppedCountBytes
;
215 UINT uiDroppedCountPackets
;
218 UINT uiCurrentDrainRate
;
219 UINT uiThisPeriodSentBytes
;
220 LARGE_INTEGER liDrainCalculated
;
221 UINT uiCurrentTokenCount
;
222 LARGE_INTEGER liLastUpdateTokenAt
;
223 UINT uiMaxAllowedRate
;
224 UINT NumOfPacketsSent
;
227 S_MIBS_EXTSERVICEFLOW_PARAMETERS stMibsExtServiceFlowTable
;
228 UINT uiCurrentRxRate
;
229 UINT uiThisPeriodRxBytes
;
239 struct sk_buff
* FirstTxQueue
;
240 struct sk_buff
* LastTxQueue
;
244 struct sk_buff
* ControlHead
;
245 struct sk_buff
* ControlTail
;
248 BOOLEAN bProtocolValid
;
250 BOOLEAN bDestIpValid
;
254 BOOLEAN bAdmittedSet
;
255 BOOLEAN bAuthorizedSet
;
256 BOOLEAN bClassifierPriority
;
257 UCHAR ucServiceClassName
[MAX_CLASS_NAME_LENGTH
];
258 BOOLEAN bHeaderSuppressionEnabled
;
259 spinlock_t SFQueueLock
;
260 void *pstSFIndication
;
261 struct timeval stLastUpdateTokenAt
;
262 atomic_t uiPerSFTxResourceCount
;
267 typedef struct _packet_info PacketInfo
;
270 typedef struct _PER_TARANG_DATA
272 struct _PER_TARANG_DATA
* next
;
273 struct _MINI_ADAPTER
* Adapter
;
274 struct sk_buff
* RxAppControlHead
;
275 struct sk_buff
* RxAppControlTail
;
276 volatile INT AppCtrlQueueLen
;
277 BOOLEAN MacTracingEnabled
;
278 BOOLEAN bApplicationToExit
;
279 S_MIBS_DROPPED_APP_CNTRL_MESSAGES stDroppedAppCntrlMsgs
;
280 ULONG RxCntrlMsgBitMask
;
281 } PER_TARANG_DATA
, *PPER_TARANG_DATA
;
285 typedef struct _TARGET_PARAMS
287 B_UINT32 m_u32CfgVersion
;
289 // Scanning Related Params
290 B_UINT32 m_u32CenterFrequency
;
291 B_UINT32 m_u32BandAScan
;
292 B_UINT32 m_u32BandBScan
;
293 B_UINT32 m_u32BandCScan
;
296 B_UINT32 m_u32minGrantsize
; // size of minimum grant is 0 or 6
297 B_UINT32 m_u32PHSEnable
;
300 B_UINT32 m_u32HoEnable
;
301 B_UINT32 m_u32HoReserved1
;
302 B_UINT32 m_u32HoReserved2
;
304 // Power Control Params
305 B_UINT32 m_u32MimoEnable
;
306 B_UINT32 m_u32SecurityEnable
;
308 * bit 1: 1 Idlemode enable;
309 * bit 2: 1 Sleepmode Enable
311 B_UINT32 m_u32PowerSavingModesEnable
;
312 /* PowerSaving Mode Options:
313 bit 0 = 1: CPE mode - to keep pcmcia if alive;
314 bit 1 = 1: CINR reporing in Idlemode Msg
315 bit 2 = 1: Default PSC Enable in sleepmode*/
316 B_UINT32 m_u32PowerSavingModeOptions
;
318 B_UINT32 m_u32ArqEnable
;
320 // From Version #3, the HARQ section renamed as general
321 B_UINT32 m_u32HarqEnable
;
322 // EEPROM Param Location
323 B_UINT32 m_u32EEPROMFlag
;
324 /* BINARY TYPE - 4th MSByte:
325 * Interface Type - 3rd MSByte:
326 * Vendor Type - 2nd MSByte
329 B_UINT32 m_u32Customize
;
330 B_UINT32 m_u32ConfigBW
; /* In Hz */
331 B_UINT32 m_u32ShutDownTimer
;
334 B_UINT32 m_u32RadioParameter
;
335 B_UINT32 m_u32PhyParameter1
;
336 B_UINT32 m_u32PhyParameter2
;
337 B_UINT32 m_u32PhyParameter3
;
339 /* in eval mode only;
340 * lower 16bits = basic cid for testing;
341 * then bit 16 is test cqich,
342 * bit 17 test init rang;
343 * bit 18 test periodic rang
344 * bit 19 is test harq ack/nack
346 B_UINT32 m_u32TestOptions
;
348 B_UINT32 m_u32MaxMACDataperDLFrame
;
349 B_UINT32 m_u32MaxMACDataperULFrame
;
351 B_UINT32 m_u32Corr2MacFlags
;
353 //adding driver params.
354 B_UINT32 HostDrvrConfig1
;
355 B_UINT32 HostDrvrConfig2
;
356 B_UINT32 HostDrvrConfig3
;
357 B_UINT32 HostDrvrConfig4
;
358 B_UINT32 HostDrvrConfig5
;
359 B_UINT32 HostDrvrConfig6
;
360 B_UINT32 m_u32SegmentedPUSCenable
;
362 // BAMC enable - but 4.x does not support this feature
363 // This is added just to sync 4.x and 5.x CFGs
364 B_UINT32 m_u32BandAMCEnable
;
365 } STARGETPARAMS
, *PSTARGETPARAMS
;
368 typedef struct _STTARGETDSXBUFFER
370 ULONG ulTargetDsxBuffer
;
373 }STTARGETDSXBUFFER
, *PSTTARGETDSXBUFFER
;
375 typedef INT (*FP_FLASH_WRITE
)(struct _MINI_ADAPTER
*,UINT
,PVOID
);
377 typedef INT (*FP_FLASH_WRITE_STATUS
)(struct _MINI_ADAPTER
*,UINT
,PVOID
);
380 Driver adapter data structure
384 struct _MINI_ADAPTER
*next
;
385 struct net_device
*dev
;
389 atomic_t ApplicationRunning
;
390 volatile INT CtrlQueueLen
;
391 atomic_t AppCtrlQueueLen
;
392 BOOLEAN AppCtrlQueueOverFlow
;
393 atomic_t CurrentApplicationCount
;
394 atomic_t RegisteredApplicationCount
;
395 BOOLEAN LinkUpStatus
;
397 u32 StatisticsPointer
;
398 struct sk_buff
*RxControlHead
;
399 struct sk_buff
*RxControlTail
;
401 struct semaphore RxAppControlQueuelock
;
402 struct semaphore fw_download_sema
;
404 PPER_TARANG_DATA pTarangs
;
405 spinlock_t control_queue_lock
;
406 wait_queue_head_t process_read_wait_queue
;
408 // the pointer to the first packet we have queued in send
409 // deserialized miniport support variables
410 atomic_t TotalPacketCount
;
413 // this to keep track of the Tx and Rx MailBox Registers.
414 atomic_t CurrNumFreeTxDesc
;
415 // to keep track the no of byte received
416 USHORT PrevNumRecvDescs
;
417 USHORT CurrNumRecvDescs
;
419 PacketInfo PackInfo
[NO_OF_QUEUES
];
420 S_CLASSIFIER_RULE astClassifierTable
[MAX_CLASSIFIERS
];
421 BOOLEAN TransferMode
;
423 /*************** qos ******************/
424 BOOLEAN bETHCSEnabled
;
427 ULONG rtPSBucketSize
;
434 wait_queue_head_t tx_packet_wait_queue
;
435 wait_queue_head_t process_rx_cntrlpkt
;
436 atomic_t process_waiting
;
437 BOOLEAN fw_download_done
;
439 char *txctlpacket
[MAX_CNTRL_PKTS
];
440 atomic_t cntrlpktCnt
;
441 atomic_t index_app_read_cntrlpkt
;
442 atomic_t index_wr_txcntrlpkt
;
443 atomic_t index_rd_txcntrlpkt
;
445 struct semaphore rdmwrmsync
;
447 STTARGETDSXBUFFER astTargetDsxBuffer
[MAX_TARGET_DSX_BUFFERS
];
448 ULONG ulFreeTargetBufferCnt
;
449 ULONG ulCurrentTargetBuffer
;
450 ULONG ulTotalTargetBuffersAvailable
;
452 unsigned long chip_id
;
454 wait_queue_head_t lowpower_mode_wait_queue
;
457 BOOLEAN bBinDownloaded
;
458 BOOLEAN bCfgDownloaded
;
459 BOOLEAN bSyncUpRequestSent
;
460 USHORT usBestEffortQueueIndex
;
462 wait_queue_head_t ioctl_fw_dnld_wait_queue
;
463 BOOLEAN waiting_to_fw_download_done
;
464 pid_t fw_download_process_pid
;
465 PSTARGETPARAMS pstargetparams
;
466 BOOLEAN device_removed
;
467 BOOLEAN DeviceAccess
;
468 BOOLEAN bIsAutoCorrectEnabled
;
469 BOOLEAN bDDRInitDone
;
471 ULONG ulPowerSaveMode
;
472 spinlock_t txtransmitlock
;
473 B_UINT8 txtransmit_running
;
474 /* Thread for control packet handling */
475 struct task_struct
*control_packet_handler
;
476 /* thread for transmitting packets. */
477 struct task_struct
*transmit_packet_thread
;
479 /* LED Related Structures */
480 LED_INFO_STRUCT LEDInfo
;
482 /* Driver State for LED Blinking */
483 LedEventInfo_t DriverState
;
484 /* Interface Specific */
485 PVOID pvInterfaceAdapter
;
486 int (*bcm_file_download
)( PVOID
,
489 int (*bcm_file_readback_from_chip
)( PVOID
,
492 INT (*interface_rdm
)(PVOID
,
496 INT (*interface_wrm
)(PVOID
,
500 int (*interface_transmit
)(PVOID
, PVOID
, UINT
);
502 BOOLEAN bDregRequestSentInIdleMode
;
503 BOOLEAN bTriedToWakeUpFromlowPowerMode
;
505 BOOLEAN bWakeUpDevice
;
506 unsigned int usIdleModePattern
;
507 //BOOLEAN bTriedToWakeUpFromShutdown;
508 BOOLEAN bLinkDownRequested
;
511 PHS_DEVICE_EXTENSION stBCMPhsContext
;
512 S_HDR_SUPRESSION_CONTEXTINFO stPhsTxContextInfo
;
513 uint8_t ucaPHSPktRestoreBuf
[2048];
518 UINT32 aTxPktSizeHist
[MIBS_MAX_HIST_ENTRIES
];
519 UINT32 aRxPktSizeHist
[MIBS_MAX_HIST_ENTRIES
];
520 S_FRAGMENTED_PACKET_INFO astFragmentedPktClassifierTable
[MAX_FRAGMENTEDIP_CLASSIFICATION_ENTRIES
];
525 UINT uiSectorSizeInCFG
;
526 BOOLEAN bSectorSizeOverride
;
527 BOOLEAN bStatusWrite
;
529 UINT uiVendorExtnFlag
;
530 //it will always represent chosen DSD at any point of time.
531 // Generally it is Active DSD but in case of NVM RD/WR it might be different.
532 UINT ulFlashCalStart
;
533 ULONG ulFlashControlSectionStart
;
534 ULONG ulFlashWriteSize
;
536 FP_FLASH_WRITE fpFlashWrite
;
537 FP_FLASH_WRITE_STATUS fpFlashWriteWithStatusCheck
;
540 struct semaphore NVMRdmWrmLock
;
542 struct device
*pstCreatedClassDevice
;
544 // BOOLEAN InterfaceUpStatus;
545 PFLASH2X_CS_INFO psFlash2xCSInfo
;
546 PFLASH_CS_INFO psFlashCSInfo
;
547 PFLASH2X_VENDORSPECIFIC_INFO psFlash2xVendorInfo
;
548 UINT uiFlashBaseAdd
; //Flash start address
549 UINT uiActiveISOOffset
; //Active ISO offset chosen before f/w download
550 FLASH2X_SECTION_VAL eActiveISO
; //Active ISO section val
551 FLASH2X_SECTION_VAL eActiveDSD
; //Active DSD val chosen before f/w download
552 UINT uiActiveDSDOffsetAtFwDld
; //For accessing Active DSD chosen before f/w download
553 UINT uiFlashLayoutMajorVersion
;
554 UINT uiFlashLayoutMinorVersion
;
555 BOOLEAN bAllDSDWriteAllow
;
556 BOOLEAN bSigCorrupted
;
557 //this should be set who so ever want to change the Headers. after Wrtie it should be reset immediately.
558 BOOLEAN bHeaderChangeAllowed
;
560 BOOLEAN bEndPointHalted
;
561 //while bFlashRawRead will be true, Driver ignore map lay out and consider flash as of without any map.
562 BOOLEAN bFlashRawRead
;
563 BOOLEAN bPreparingForLowPowerMode
;
565 UINT syscfgBefFwDld
;
566 BOOLEAN StopAllXaction
;
567 UINT32 liTimeSinceLastNetEntry
; //Used to Support extended CAPI requirements from
568 struct semaphore LowPowerModeSync
;
569 ULONG liDrainCalculated
;
572 S_BCM_DEBUG_STATE stDebugState
;
575 typedef struct _MINI_ADAPTER MINI_ADAPTER
, *PMINI_ADAPTER
;
577 #define GET_BCM_ADAPTER(net_dev) netdev_priv(net_dev)
579 struct _ETH_HEADER_STRUC
{
580 UCHAR au8DestinationAddress
[6];
581 UCHAR au8SourceAddress
[6];
583 }__attribute__((packed
));
584 typedef struct _ETH_HEADER_STRUC ETH_HEADER_STRUC
, *PETH_HEADER_STRUC
;
587 typedef struct FirmwareInfo
589 void __user
* pvMappedFirmwareAddress
;
590 ULONG u32FirmwareLength
;
591 ULONG u32StartingAddress
;
592 }__attribute__((packed
)) FIRMWARE_INFO
, *PFIRMWARE_INFO
;
594 // holds the value of net_device structure..
595 extern struct net_device
*gblpnetdev
;
596 typedef struct _cntl_pkt
{
597 PMINI_ADAPTER Adapter
;
600 typedef LINK_REQUEST CONTROL_MESSAGE
;
602 typedef struct _DDR_SETTING
606 }DDR_SETTING
, *PDDR_SETTING
;
607 typedef DDR_SETTING DDR_SET_NODE
, *PDDR_SET_NODE
;
609 InitAdapter(PMINI_ADAPTER psAdapter
);
611 // =====================================================================
612 // Beceem vendor request codes for EP0
613 // =====================================================================
615 #define BCM_REQUEST_READ 0x2
616 #define BCM_REQUEST_WRITE 0x1
617 #define EP2_MPS_REG 0x0F0110A0
620 #define EP2_CFG_REG 0x0F0110A8
621 #define EP2_CFG_INT 0x27
622 #define EP2_CFG_BULK 0x25
624 #define EP4_MPS_REG 0x0F0110F0
627 #define EP4_CFG_REG 0x0F0110F8
629 #define ISO_MPS_REG 0x0F0110C8
630 #define ISO_MPS 0x00000000
641 typedef enum eInterface_setting
643 DEFAULT_SETTING_0
= 0,
644 ALTERNATE_SETTING_1
= 1,
647 #endif //__ADAPTER_H__