3 static VOID
default_wimax_protocol_initialize(PMINI_ADAPTER Adapter
)
8 for(uiLoopIndex
=0; uiLoopIndex
< NO_OF_QUEUES
-1; uiLoopIndex
++)
10 Adapter
->PackInfo
[uiLoopIndex
].uiThreshold
=TX_PACKET_THRESHOLD
;
11 Adapter
->PackInfo
[uiLoopIndex
].uiMaxAllowedRate
=MAX_ALLOWED_RATE
;
12 Adapter
->PackInfo
[uiLoopIndex
].uiMaxBucketSize
=20*1024*1024;
15 Adapter
->BEBucketSize
=BE_BUCKET_SIZE
;
16 Adapter
->rtPSBucketSize
=rtPS_BUCKET_SIZE
;
17 Adapter
->LinkStatus
=SYNC_UP_REQUEST
;
18 Adapter
->TransferMode
=IP_PACKET_ONLY_MODE
;
19 Adapter
->usBestEffortQueueIndex
=-1;
25 InitAdapter(PMINI_ADAPTER psAdapter
)
28 INT Status
= STATUS_SUCCESS
;
29 BCM_DEBUG_PRINT(psAdapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "Initialising Adapter = %p", psAdapter
);
33 BCM_DEBUG_PRINT(psAdapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "Adapter is NULL");
37 sema_init(&psAdapter
->NVMRdmWrmLock
,1);
38 // psAdapter->ulFlashCalStart = FLASH_AUTO_INIT_BASE_ADDR;
40 sema_init(&psAdapter
->rdmwrmsync
, 1);
41 spin_lock_init(&psAdapter
->control_queue_lock
);
42 spin_lock_init(&psAdapter
->txtransmitlock
);
43 sema_init(&psAdapter
->RxAppControlQueuelock
, 1);
44 // sema_init(&psAdapter->data_packet_queue_lock, 1);
45 sema_init(&psAdapter
->fw_download_sema
, 1);
46 sema_init(&psAdapter
->LowPowerModeSync
,1);
48 // spin_lock_init(&psAdapter->sleeper_lock);
50 for(i
=0;i
<NO_OF_QUEUES
; i
++)
51 spin_lock_init(&psAdapter
->PackInfo
[i
].SFQueueLock
);
54 init_waitqueue_head(&psAdapter
->process_rx_cntrlpkt
);
55 init_waitqueue_head(&psAdapter
->tx_packet_wait_queue
);
56 init_waitqueue_head(&psAdapter
->process_read_wait_queue
);
57 init_waitqueue_head(&psAdapter
->ioctl_fw_dnld_wait_queue
);
58 init_waitqueue_head(&psAdapter
->lowpower_mode_wait_queue
);
59 psAdapter
->waiting_to_fw_download_done
= TRUE
;
60 //init_waitqueue_head(&psAdapter->device_wake_queue);
61 psAdapter
->fw_download_done
=FALSE
;
63 psAdapter
->pvOsDepData
= (PLINUX_DEP_DATA
) kmalloc(sizeof(LINUX_DEP_DATA
),
66 if(psAdapter
->pvOsDepData
== NULL
)
68 BCM_DEBUG_PRINT(psAdapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "Linux Specific Data allocation failed");
71 memset(psAdapter
->pvOsDepData
, 0, sizeof(LINUX_DEP_DATA
));
73 default_wimax_protocol_initialize(psAdapter
);
74 for (i
=0;i
<MAX_CNTRL_PKTS
;i
++)
76 psAdapter
->txctlpacket
[i
] = (char *)kmalloc(MAX_CNTL_PKT_SIZE
,
78 if(!psAdapter
->txctlpacket
[i
])
80 BCM_DEBUG_PRINT(psAdapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "No More Cntl pkts got, max got is %d", i
);
84 if(AllocAdapterDsxBuffer(psAdapter
))
86 BCM_DEBUG_PRINT(psAdapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "Failed to allocate DSX buffers");
90 //Initialize PHS interface
91 if(phs_init(&psAdapter
->stBCMPhsContext
,psAdapter
)!=0)
93 BCM_DEBUG_PRINT(psAdapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
,"%s:%s:%d:Error PHS Init Failed=====>\n", __FILE__
, __FUNCTION__
, __LINE__
);
97 Status
= BcmAllocFlashCSStructure(psAdapter
);
100 BCM_DEBUG_PRINT(psAdapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
,"Memory Allocation for Flash structure failed");
104 Status
= vendorextnInit(psAdapter
);
106 if(STATUS_SUCCESS
!= Status
)
108 BCM_DEBUG_PRINT(psAdapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
,"Vendor Init Failed");
112 BCM_DEBUG_PRINT(psAdapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "Adapter initialised");
115 return STATUS_SUCCESS
;
118 VOID
AdapterFree(PMINI_ADAPTER Adapter
)
122 beceem_protocol_reset(Adapter
);
124 vendorextnExit(Adapter
);
126 if(Adapter
->control_packet_handler
&& !IS_ERR(Adapter
->control_packet_handler
))
127 kthread_stop (Adapter
->control_packet_handler
);
128 if(Adapter
->transmit_packet_thread
&& !IS_ERR(Adapter
->transmit_packet_thread
))
129 kthread_stop (Adapter
->transmit_packet_thread
);
130 wake_up(&Adapter
->process_read_wait_queue
);
131 if(Adapter
->LEDInfo
.led_thread_running
& (BCM_LED_THREAD_RUNNING_ACTIVELY
| BCM_LED_THREAD_RUNNING_INACTIVELY
))
132 kthread_stop (Adapter
->LEDInfo
.led_cntrl_threadid
);
133 bcm_unregister_networkdev(Adapter
);
134 while(atomic_read(&Adapter
->ApplicationRunning
))
136 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "Waiting for Application to close.. %d\n",atomic_read(&Adapter
->ApplicationRunning
));
139 unregister_control_device_interface(Adapter
);
140 if(Adapter
->dev
&& !IS_ERR(Adapter
->dev
))
141 free_netdev(Adapter
->dev
);
142 if(Adapter
->pstargetparams
!= NULL
)
144 bcm_kfree(Adapter
->pstargetparams
);
146 for (count
=0;count
< MAX_CNTRL_PKTS
;count
++)
148 if(Adapter
->txctlpacket
[count
])
149 bcm_kfree(Adapter
->txctlpacket
[count
]);
151 FreeAdapterDsxBuffer(Adapter
);
152 if(Adapter
->pvOsDepData
)
153 bcm_kfree (Adapter
->pvOsDepData
);
154 if(Adapter
->pvInterfaceAdapter
)
155 bcm_kfree(Adapter
->pvInterfaceAdapter
);
157 //Free the PHS Interface
158 PhsCleanup(&Adapter
->stBCMPhsContext
);
160 #ifndef BCM_SHM_INTERFACE
161 BcmDeAllocFlashCSStructure(Adapter
);
165 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "<========\n");
169 int create_worker_threads(PMINI_ADAPTER psAdapter
)
171 BCM_DEBUG_PRINT(psAdapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "Init Threads...");
172 // Rx Control Packets Processing
173 psAdapter
->control_packet_handler
= kthread_run((int (*)(void *))
174 control_packet_handler
, psAdapter
, "CtrlPktHdlr");
175 if(IS_ERR(psAdapter
->control_packet_handler
))
177 BCM_DEBUG_PRINT(psAdapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "No Kernel Thread, but still returning success\n");
178 return PTR_ERR(psAdapter
->control_packet_handler
);
181 psAdapter
->transmit_packet_thread
= kthread_run((int (*)(void *))
182 tx_pkt_handler
, psAdapter
, "TxPktThread");
183 if(IS_ERR (psAdapter
->transmit_packet_thread
))
185 BCM_DEBUG_PRINT(psAdapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "No Kernel Thread, but still returning success");
186 kthread_stop(psAdapter
->control_packet_handler
);
187 return PTR_ERR(psAdapter
->transmit_packet_thread
);
193 static inline struct file
*open_firmware_file(PMINI_ADAPTER Adapter
, char *path
)
195 struct file
*flp
=NULL
;
199 flp
=filp_open(path
, O_RDONLY
, S_IRWXU
);
203 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "Unable To Open File %s, err %lx",
209 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "Got file descriptor pointer of %s!",
212 if(Adapter
->device_removed
)
221 int BcmFileDownload(PMINI_ADAPTER Adapter
,/**< Logical Adapter */
222 char *path
, /**< path to image file */
223 unsigned int loc
/**< Download Address on the chip*/
227 struct file
*flp
=NULL
;
229 struct timeval tv
={0};
231 flp
=open_firmware_file(Adapter
, path
);
235 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "Unable to Open %s\n", path
);
238 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "Opened file is = %s and length =0x%lx to be downloaded at =0x%x", path
,(unsigned long)flp
->f_dentry
->d_inode
->i_size
, loc
);
239 do_gettimeofday(&tv
);
241 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "download start %lx", ((tv
.tv_sec
* 1000) +
243 if(Adapter
->bcm_file_download(Adapter
->pvInterfaceAdapter
, flp
, loc
))
245 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "Failed to download the firmware with error\
250 oldfs
=get_fs();set_fs(get_ds());
251 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
252 vfs_llseek(flp
, 0, 0);
255 if(Adapter
->bcm_file_readback_from_chip(Adapter
->pvInterfaceAdapter
,
258 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "Failed to read back firmware!");
264 oldfs
=get_fs();set_fs(get_ds());
265 if(flp
&& !(IS_ERR(flp
)))
266 filp_close(flp
, current
->files
);
268 do_gettimeofday(&tv
);
269 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "file download done at %lx", ((tv
.tv_sec
* 1000) +
275 void bcm_kfree_skb(struct sk_buff
*skb
)
284 VOID
bcm_kfree(VOID
*ptr
)
294 @ingroup ctrl_pkt_functions
295 This function copies the contents of given buffer
296 to the control packet and queues it for transmission.
297 @note Do not acquire the spinock, as it it already acquired.
298 @return SUCCESS/FAILURE.
300 INT
CopyBufferToControlPacket(PMINI_ADAPTER Adapter
,/**<Logical Adapter*/
301 PVOID ioBuffer
/**<Control Packet Buffer*/
304 PLEADER pLeader
=NULL
;
306 unsigned char *ctrl_buff
=NULL
;
308 PLINK_REQUEST pLinkReq
= NULL
;
309 PUCHAR pucAddIndication
= NULL
;
311 BCM_DEBUG_PRINT( Adapter
,DBG_TYPE_TX
, TX_CONTROL
, DBG_LVL_ALL
, "======>");
314 BCM_DEBUG_PRINT( Adapter
,DBG_TYPE_TX
, TX_CONTROL
,DBG_LVL_ALL
, "Got Null Buffer\n");
318 pLinkReq
= (PLINK_REQUEST
)ioBuffer
;
319 pLeader
=(PLEADER
)ioBuffer
; //ioBuffer Contains sw_Status and Payload
321 if(Adapter
->bShutStatus
== TRUE
&&
322 pLinkReq
->szData
[0] == LINK_DOWN_REQ_PAYLOAD
&&
323 pLinkReq
->szData
[1] == LINK_SYNC_UP_SUBTYPE
)
325 //Got sync down in SHUTDOWN..we could not process this.
326 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_TX
, TX_CONTROL
,DBG_LVL_ALL
, "SYNC DOWN Request in Shut Down Mode..\n");
327 return STATUS_FAILURE
;
330 if((pLeader
->Status
== LINK_UP_CONTROL_REQ
) &&
331 ((pLinkReq
->szData
[0] == LINK_UP_REQ_PAYLOAD
&&
332 (pLinkReq
->szData
[1] == LINK_SYNC_UP_SUBTYPE
)) ||//Sync Up Command
333 pLinkReq
->szData
[0] == NETWORK_ENTRY_REQ_PAYLOAD
)) //Net Entry Command
335 if(Adapter
->LinkStatus
> PHY_SYNC_ACHIVED
)
337 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_TX
, TX_CONTROL
,DBG_LVL_ALL
,"LinkStatus is Greater than PHY_SYN_ACHIEVED");
338 return STATUS_FAILURE
;
340 if(TRUE
== Adapter
->bShutStatus
)
342 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_TX
, TX_CONTROL
,DBG_LVL_ALL
, "SYNC UP IN SHUTDOWN..Device WakeUp\n");
343 if(Adapter
->bTriedToWakeUpFromlowPowerMode
== FALSE
)
345 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_TX
, TX_CONTROL
,DBG_LVL_ALL
, "Waking up for the First Time..\n");
346 Adapter
->usIdleModePattern
= ABORT_SHUTDOWN_MODE
; // change it to 1 for current support.
347 Adapter
->bWakeUpDevice
= TRUE
;
348 wake_up(&Adapter
->process_rx_cntrlpkt
);
350 Status
= wait_event_interruptible_timeout(Adapter
->lowpower_mode_wait_queue
,
351 !Adapter
->bShutStatus
, (5 * HZ
));
353 if(Status
== -ERESTARTSYS
)
356 if(Adapter
->bShutStatus
)
358 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_TX
, TX_CONTROL
,DBG_LVL_ALL
, "Shutdown Mode Wake up Failed - No Wake Up Received\n");
359 return STATUS_FAILURE
;
364 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_TX
, TX_CONTROL
,DBG_LVL_ALL
, "Wakeup has been tried already...\n");
369 if(TRUE
== Adapter
->IdleMode
)
371 //BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0,"Device is in Idle mode ... hence \n");
372 if(pLeader
->Status
== LINK_UP_CONTROL_REQ
|| pLeader
->Status
== 0x80 ||
373 pLeader
->Status
== CM_CONTROL_NEWDSX_MULTICLASSIFIER_REQ
)
376 if((pLeader
->Status
== LINK_UP_CONTROL_REQ
) && (pLinkReq
->szData
[0]==LINK_DOWN_REQ_PAYLOAD
))
378 if((pLinkReq
->szData
[1] == LINK_SYNC_DOWN_SUBTYPE
))
380 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_TX
, TX_CONTROL
,DBG_LVL_ALL
, "Link Down Sent in Idle Mode\n");
381 Adapter
->usIdleModePattern
= ABORT_IDLE_SYNCDOWN
;//LINK DOWN sent in Idle Mode
385 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_TX
, TX_CONTROL
,DBG_LVL_ALL
,"ABORT_IDLE_MODE pattern is being written\n");
386 Adapter
->usIdleModePattern
= ABORT_IDLE_REG
;
391 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_TX
, TX_CONTROL
,DBG_LVL_ALL
,"ABORT_IDLE_MODE pattern is being written\n");
392 Adapter
->usIdleModePattern
= ABORT_IDLE_MODE
;
395 /*Setting bIdleMode_tx_from_host to TRUE to indicate LED control thread to represent
396 the wake up from idlemode is from host*/
397 //Adapter->LEDInfo.bIdleMode_tx_from_host = TRUE;
399 if(STATUS_SUCCESS
!= InterfaceIdleModeWakeup(Adapter
))
401 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_TX
, NEXT_SEND
, DBG_LVL_ALL
, "Idle Mode Wake up Failed\n");
402 return STATUS_FAILURE
;
405 Adapter
->bWakeUpDevice
= TRUE
;
406 wake_up(&Adapter
->process_rx_cntrlpkt
);
410 if(LINK_DOWN_REQ_PAYLOAD
== pLinkReq
->szData
[0])
412 // We should not send DREG message down while in idlemode.
413 return STATUS_SUCCESS
;
416 Status
= wait_event_interruptible_timeout(Adapter
->lowpower_mode_wait_queue
,
417 !Adapter
->IdleMode
, (5 * HZ
));
419 if(Status
== -ERESTARTSYS
)
422 if(Adapter
->IdleMode
)
424 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_TX
, TX_CONTROL
,DBG_LVL_ALL
, "Idle Mode Wake up Failed - No Wake Up Received\n");
425 return STATUS_FAILURE
;
429 return STATUS_SUCCESS
;
431 //The Driver has to send control messages with a particular VCID
432 pLeader
->Vcid
= VCID_CONTROL_PACKET
;//VCID for control packet.
434 /* Allocate skb for Control Packet */
435 pktlen
= pLeader
->PLength
;
436 ctrl_buff
= (char *)Adapter
->txctlpacket
[atomic_read(&Adapter
->index_wr_txcntrlpkt
)%MAX_CNTRL_PKTS
];
438 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_TX
, TX_CONTROL
,DBG_LVL_ALL
, "Control packet to be taken =%d and address is =%pincoming address is =%p and packet len=%x",
439 atomic_read(&Adapter
->index_wr_txcntrlpkt
), ctrl_buff
, ioBuffer
, pktlen
);
444 if((pLeader
->Status
== 0x80) ||
445 (pLeader
->Status
== CM_CONTROL_NEWDSX_MULTICLASSIFIER_REQ
))
448 //Restructure the DSX message to handle Multiple classifier Support
449 // Write the Service Flow param Structures directly to the target
450 //and embed the pointers in the DSX messages sent to target.
452 //Lets store the current length of the control packet we are transmitting
453 pucAddIndication
= (PUCHAR
)ioBuffer
+ LEADER_SIZE
;
454 pktlen
= pLeader
->PLength
;
455 Status
= StoreCmControlResponseMessage(Adapter
,pucAddIndication
, &pktlen
);
458 ClearTargetDSXBuffer(Adapter
,((stLocalSFAddIndicationAlt
*)pucAddIndication
)->u16TID
, FALSE
);
459 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_TX
, TX_CONTROL
, DBG_LVL_ALL
, " Error Restoring The DSX Control Packet. Dsx Buffers on Target may not be Setup Properly ");
460 return STATUS_FAILURE
;
463 //update the leader to use the new length
464 //The length of the control packet is length of message being sent + Leader length
466 pLeader
->PLength
= pktlen
;
469 memset(ctrl_buff
, 0, pktlen
+LEADER_SIZE
);
470 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_TX
, TX_CONTROL
, DBG_LVL_ALL
, "Copying the Control Packet Buffer with length=%d\n", pLeader
->PLength
);
471 *(PLEADER
)ctrl_buff
=*pLeader
;
472 memcpy(ctrl_buff
+ LEADER_SIZE
, ((PUCHAR
)ioBuffer
+ LEADER_SIZE
), pLeader
->PLength
);
473 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_TX
, TX_CONTROL
, DBG_LVL_ALL
, "Enqueuing the Control Packet");
475 /*Update the statistics counters */
476 spin_lock_bh(&Adapter
->PackInfo
[HiPriority
].SFQueueLock
);
477 Adapter
->PackInfo
[HiPriority
].uiCurrentBytesOnHost
+=pLeader
->PLength
;
478 Adapter
->PackInfo
[HiPriority
].uiCurrentPacketsOnHost
++;
479 atomic_inc(&Adapter
->TotalPacketCount
);
480 spin_unlock_bh(&Adapter
->PackInfo
[HiPriority
].SFQueueLock
);
482 Adapter
->PackInfo
[HiPriority
].bValid
= TRUE
;
484 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_TX
, TX_CONTROL
, DBG_LVL_ALL
, "CurrBytesOnHost: %x bValid: %x",
485 Adapter
->PackInfo
[HiPriority
].uiCurrentBytesOnHost
,
486 Adapter
->PackInfo
[HiPriority
].bValid
);
487 Status
=STATUS_SUCCESS
;
488 /*Queue the packet for transmission */
489 atomic_inc(&Adapter
->index_wr_txcntrlpkt
);
490 BCM_DEBUG_PRINT( Adapter
,DBG_TYPE_TX
, TX_CONTROL
,DBG_LVL_ALL
, "Calling transmit_packets");
491 atomic_set(&Adapter
->TxPktAvail
, 1);
492 #ifdef BCM_SHM_INTERFACE
493 virtual_mail_box_interrupt();
495 wake_up(&Adapter
->tx_packet_wait_queue
);
500 BCM_DEBUG_PRINT( Adapter
,DBG_TYPE_TX
, TX_CONTROL
, DBG_LVL_ALL
, "mem allocation Failed");
502 BCM_DEBUG_PRINT( Adapter
,DBG_TYPE_TX
, TX_CONTROL
, DBG_LVL_ALL
, "<====");
507 /*****************************************************************
508 * Function - SendStatisticsPointerRequest()
510 * Description - This function builds and forwards the Statistics
511 * Pointer Request control Packet.
513 * Parameters - Adapter : Pointer to Adapter structure.
514 * - pstStatisticsPtrRequest : Pointer to link request.
517 *****************************************************************/
518 static VOID
SendStatisticsPointerRequest(PMINI_ADAPTER Adapter
,
519 PLINK_REQUEST pstStatisticsPtrRequest
)
521 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_RX
, RX_DPC
, DBG_LVL_ALL
, "======>");
522 pstStatisticsPtrRequest
->Leader
.Status
= STATS_POINTER_REQ_STATUS
;
523 pstStatisticsPtrRequest
->Leader
.PLength
= sizeof(ULONG
);//minimum 4 bytes
524 pstStatisticsPtrRequest
->szData
[0] = STATISTICS_POINTER_REQ
;
526 CopyBufferToControlPacket(Adapter
,pstStatisticsPtrRequest
);
527 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_RX
, RX_DPC
, DBG_LVL_ALL
, "<=====");
533 void SendLinkDown(PMINI_ADAPTER Adapter
)
535 LINK_REQUEST stLinkDownRequest
;
536 memset(&stLinkDownRequest
, 0, sizeof(LINK_REQUEST
));
537 stLinkDownRequest
.Leader
.Status
=LINK_UP_CONTROL_REQ
;
538 stLinkDownRequest
.Leader
.PLength
=sizeof(ULONG
);//minimum 4 bytes
539 stLinkDownRequest
.szData
[0]=LINK_DOWN_REQ_PAYLOAD
;
540 Adapter
->bLinkDownRequested
= TRUE
;
542 CopyBufferToControlPacket(Adapter
,&stLinkDownRequest
);
545 /******************************************************************
546 * Function - LinkMessage()
548 * Description - This function builds the Sync-up and Link-up request
549 * packet messages depending on the device Link status.
551 * Parameters - Adapter: Pointer to the Adapter structure.
554 *******************************************************************/
555 __inline VOID
LinkMessage(PMINI_ADAPTER Adapter
)
557 PLINK_REQUEST pstLinkRequest
=NULL
;
558 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_OTHERS
, LINK_UP_MSG
, DBG_LVL_ALL
, "=====>");
559 if(Adapter
->LinkStatus
== SYNC_UP_REQUEST
&& Adapter
->AutoSyncup
)
561 pstLinkRequest
=kmalloc(sizeof(LINK_REQUEST
), GFP_ATOMIC
);
564 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_OTHERS
, LINK_UP_MSG
, DBG_LVL_ALL
, "Can not allocate memory for Link request!");
567 memset(pstLinkRequest
,0,sizeof(LINK_REQUEST
));
569 Adapter
->LinkStatus
= WAIT_FOR_SYNC
;// current link status
570 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_OTHERS
, LINK_UP_MSG
, DBG_LVL_ALL
, "Requesting For SyncUp...");
571 pstLinkRequest
->szData
[0]=LINK_UP_REQ_PAYLOAD
;
572 pstLinkRequest
->szData
[1]=LINK_SYNC_UP_SUBTYPE
;
573 pstLinkRequest
->Leader
.Status
=LINK_UP_CONTROL_REQ
;
574 pstLinkRequest
->Leader
.PLength
=sizeof(ULONG
);
575 Adapter
->bSyncUpRequestSent
= TRUE
;
577 else if(Adapter
->LinkStatus
== PHY_SYNC_ACHIVED
&& Adapter
->AutoLinkUp
)
579 pstLinkRequest
=kmalloc(sizeof(LINK_REQUEST
), GFP_ATOMIC
);
582 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_OTHERS
, LINK_UP_MSG
, DBG_LVL_ALL
, "Can not allocate memory for Link request!");
585 memset(pstLinkRequest
,0,sizeof(LINK_REQUEST
));
587 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_OTHERS
, LINK_UP_MSG
, DBG_LVL_ALL
, "Requesting For LinkUp...");
588 pstLinkRequest
->szData
[0]=LINK_UP_REQ_PAYLOAD
;
589 pstLinkRequest
->szData
[1]=LINK_NET_ENTRY
;
590 pstLinkRequest
->Leader
.Status
=LINK_UP_CONTROL_REQ
;
591 pstLinkRequest
->Leader
.PLength
=sizeof(ULONG
);
595 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_OTHERS
, LINK_UP_MSG
, DBG_LVL_ALL
, "Calling CopyBufferToControlPacket");
596 CopyBufferToControlPacket(Adapter
, pstLinkRequest
);
597 bcm_kfree(pstLinkRequest
);
599 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_OTHERS
, LINK_UP_MSG
, DBG_LVL_ALL
, "LinkMessage <=====");
604 /**********************************************************************
605 * Function - StatisticsResponse()
607 * Description - This function handles the Statistics response packet.
609 * Parameters - Adapter : Pointer to the Adapter structure.
610 * - pvBuffer: Starting address of Statistic response data.
613 ************************************************************************/
614 VOID
StatisticsResponse(PMINI_ADAPTER Adapter
,PVOID pvBuffer
)
616 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
, "%s====>",__FUNCTION__
);
617 Adapter
->StatisticsPointer
= ntohl(*(PULONG
)pvBuffer
);
618 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
, "Stats at %lx", Adapter
->StatisticsPointer
);
619 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
, "%s <====",__FUNCTION__
);
624 /**********************************************************************
625 * Function - LinkControlResponseMessage()
627 * Description - This function handles the Link response packets.
629 * Parameters - Adapter : Pointer to the Adapter structure.
630 * - pucBuffer: Starting address of Link response data.
633 ***********************************************************************/
634 VOID
LinkControlResponseMessage(PMINI_ADAPTER Adapter
,PUCHAR pucBuffer
)
636 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_RX
, RX_DPC
, DBG_LVL_ALL
, "=====>");
638 if(*pucBuffer
==LINK_UP_ACK
)
640 switch(*(pucBuffer
+1))
642 case PHY_SYNC_ACHIVED
: //SYNCed UP
643 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0, "PHY_SYNC_ACHIVED");
645 if(Adapter
->LinkStatus
== LINKUP_DONE
)
647 beceem_protocol_reset(Adapter
);
650 Adapter
->usBestEffortQueueIndex
=INVALID_QUEUE_INDEX
;
651 Adapter
->LinkStatus
=PHY_SYNC_ACHIVED
;
653 if(Adapter
->LEDInfo
.led_thread_running
& BCM_LED_THREAD_RUNNING_ACTIVELY
)
655 Adapter
->DriverState
= NO_NETWORK_ENTRY
;
656 wake_up(&Adapter
->LEDInfo
.notify_led_event
);
659 LinkMessage(Adapter
);
663 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_RX
, RX_DPC
, DBG_LVL_ALL
, "LINKUP_DONE");
664 Adapter
->LinkStatus
=LINKUP_DONE
;
665 Adapter
->bPHSEnabled
= *(pucBuffer
+3);
666 Adapter
->bETHCSEnabled
= *(pucBuffer
+4) & ETH_CS_MASK
;
667 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0, "PHS Support Status Recieved In LinkUp Ack : %x \n",Adapter
->bPHSEnabled
);
668 if((FALSE
== Adapter
->bShutStatus
)&&
669 (FALSE
== Adapter
->IdleMode
))
671 if(Adapter
->LEDInfo
.led_thread_running
& BCM_LED_THREAD_RUNNING_ACTIVELY
)
673 Adapter
->DriverState
= NORMAL_OPERATION
;
674 wake_up(&Adapter
->LEDInfo
.notify_led_event
);
677 LinkMessage(Adapter
);
682 * Driver to ignore the DREG_RECEIVED
683 * WiMAX Application should handle this Message
685 //Adapter->liTimeSinceLastNetEntry = 0;
686 Adapter
->LinkUpStatus
= 0;
687 Adapter
->LinkStatus
= 0;
688 Adapter
->usBestEffortQueueIndex
=INVALID_QUEUE_INDEX
;
689 Adapter
->bTriedToWakeUpFromlowPowerMode
= FALSE
;
690 Adapter
->IdleMode
= FALSE
;
691 beceem_protocol_reset(Adapter
);
694 case LINK_SHUTDOWN_REQ_FROM_FIRMWARE
:
695 case COMPLETE_WAKE_UP_NOTIFICATION_FRM_FW
:
697 HandleShutDownModeRequest(Adapter
, pucBuffer
);
701 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0, "default case:LinkResponse %x",*(pucBuffer
+1));
705 else if(SET_MAC_ADDRESS_RESPONSE
==*pucBuffer
)
707 PUCHAR puMacAddr
= (pucBuffer
+ 1);
708 Adapter
->LinkStatus
=SYNC_UP_REQUEST
;
709 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_RX
, RX_DPC
, DBG_LVL_ALL
, "MAC address response, sending SYNC_UP");
710 LinkMessage(Adapter
);
711 memcpy(Adapter
->dev
->dev_addr
, puMacAddr
, MAC_ADDRESS_SIZE
);
713 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_RX
, RX_DPC
, DBG_LVL_ALL
, "%s <=====",__FUNCTION__
);
717 void SendIdleModeResponse(PMINI_ADAPTER Adapter
)
719 INT status
= 0, NVMAccess
= 0,lowPwrAbortMsg
= 0;
721 CONTROL_MESSAGE stIdleResponse
= {{0}};
722 memset(&tv
, 0, sizeof(tv
));
723 stIdleResponse
.Leader
.Status
= IDLE_MESSAGE
;
724 stIdleResponse
.Leader
.PLength
= IDLE_MODE_PAYLOAD_LENGTH
;
725 stIdleResponse
.szData
[0] = GO_TO_IDLE_MODE_PAYLOAD
;
726 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_RX
, RX_DPC
, DBG_LVL_ALL
," ============>");
728 /*********************************
730 ** if [ semaphore is available ]
731 ** acquire semaphone and return value 0 ;
733 ** return non-zero value ;
735 ***********************************/
737 NVMAccess
= down_trylock(&Adapter
->NVMRdmWrmLock
);
739 lowPwrAbortMsg
= down_trylock(&Adapter
->LowPowerModeSync
);
742 if((NVMAccess
|| lowPwrAbortMsg
|| atomic_read(&Adapter
->TotalPacketCount
)) &&
743 (Adapter
->ulPowerSaveMode
!= DEVICE_POWERSAVE_MODE_AS_PROTOCOL_IDLE_MODE
) )
746 up(&Adapter
->NVMRdmWrmLock
);
749 up(&Adapter
->LowPowerModeSync
);
751 stIdleResponse
.szData
[1] = TARGET_CAN_NOT_GO_TO_IDLE_MODE
;//NACK- device access is going on.
752 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_RX
, RX_DPC
, DBG_LVL_ALL
, "HOST IS NACKING Idle mode To F/W!!!!!!!!");
753 Adapter
->bPreparingForLowPowerMode
= FALSE
;
757 stIdleResponse
.szData
[1] = TARGET_CAN_GO_TO_IDLE_MODE
; //2;//Idle ACK
758 Adapter
->StatisticsPointer
= 0;
760 /* Wait for the LED to TURN OFF before sending ACK response */
761 if(Adapter
->LEDInfo
.led_thread_running
& BCM_LED_THREAD_RUNNING_ACTIVELY
)
765 /* Wake the LED Thread with IDLEMODE_ENTER State */
766 Adapter
->DriverState
= LOWPOWER_MODE_ENTER
;
767 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_RX
, RX_DPC
, DBG_LVL_ALL
,"LED Thread is Running..Hence Setting LED Event as IDLEMODE_ENTER jiffies:%ld",jiffies
);;
768 wake_up(&Adapter
->LEDInfo
.notify_led_event
);
770 /* Wait for 1 SEC for LED to OFF */
771 iRetVal
= wait_event_timeout(Adapter
->LEDInfo
.idleModeSyncEvent
, \
772 Adapter
->LEDInfo
.bIdle_led_off
, msecs_to_jiffies(1000));
775 /* If Timed Out to Sync IDLE MODE Enter, do IDLE mode Exit and Send NACK to device */
778 stIdleResponse
.szData
[1] = TARGET_CAN_NOT_GO_TO_IDLE_MODE
;//NACK- device access is going on.
779 Adapter
->DriverState
= NORMAL_OPERATION
;
780 wake_up(&Adapter
->LEDInfo
.notify_led_event
);
781 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_RX
, RX_DPC
, DBG_LVL_ALL
, "NACKING Idle mode as time out happen from LED side!!!!!!!!");
784 if(stIdleResponse
.szData
[1] == TARGET_CAN_GO_TO_IDLE_MODE
)
786 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_RX
, RX_DPC
, DBG_LVL_ALL
,"ACKING IDLE MODE !!!!!!!!!");
787 down(&Adapter
->rdmwrmsync
);
788 Adapter
->bPreparingForLowPowerMode
= TRUE
;
789 up(&Adapter
->rdmwrmsync
);
790 #ifndef BCM_SHM_INTERFACE
792 if(Adapter
->bDoSuspend
== TRUE
)
793 Bcm_kill_all_URBs((PS_INTERFACE_ADAPTER
)(Adapter
->pvInterfaceAdapter
));
799 Adapter
->bPreparingForLowPowerMode
= FALSE
;
803 up(&Adapter
->NVMRdmWrmLock
);
806 up(&Adapter
->LowPowerModeSync
);
809 status
= CopyBufferToControlPacket(Adapter
,&stIdleResponse
);
810 if((status
!= STATUS_SUCCESS
))
812 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"fail to send the Idle mode Request \n");
813 Adapter
->bPreparingForLowPowerMode
= FALSE
;
814 #ifndef BCM_SHM_INTERFACE
815 StartInterruptUrb((PS_INTERFACE_ADAPTER
)(Adapter
->pvInterfaceAdapter
));
818 do_gettimeofday(&tv
);
819 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_RX
, RX_DPC
, DBG_LVL_ALL
, "IdleMode Msg submitter to Q :%ld ms", tv
.tv_sec
*1000 + tv
.tv_usec
/1000);
823 /******************************************************************
824 * Function - DumpPackInfo()
826 * Description - This function dumps the all Queue(PackInfo[]) details.
828 * Parameters - Adapter: Pointer to the Adapter structure.
831 *******************************************************************/
832 VOID
DumpPackInfo(PMINI_ADAPTER Adapter
)
835 UINT uiLoopIndex
= 0;
837 UINT uiClsfrIndex
= 0;
838 S_CLASSIFIER_RULE
*pstClassifierEntry
= NULL
;
840 for(uiLoopIndex
=0;uiLoopIndex
<NO_OF_QUEUES
;uiLoopIndex
++)
842 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"*********** Showing Details Of Queue %d***** ******",uiLoopIndex
);
843 if(FALSE
== Adapter
->PackInfo
[uiLoopIndex
].bValid
)
845 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"bValid is FALSE for %X index\n",uiLoopIndex
);
849 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
," Dumping SF Rule Entry For SFID %lX \n",Adapter
->PackInfo
[uiLoopIndex
].ulSFID
);
850 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
," ucDirection %X \n",Adapter
->PackInfo
[uiLoopIndex
].ucDirection
);
851 if(Adapter
->PackInfo
[uiLoopIndex
].ucIpVersion
== IPV6
)
853 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"Ipv6 Service Flow \n");
857 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"Ipv4 Service Flow \n");
859 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
," SF Traffic Priority %X \n",Adapter
->PackInfo
[uiLoopIndex
].u8TrafficPriority
);
861 for(uiClsfrIndex
=0;uiClsfrIndex
<MAX_CLASSIFIERS
;uiClsfrIndex
++)
863 pstClassifierEntry
= &Adapter
->astClassifierTable
[uiClsfrIndex
];
864 if(!pstClassifierEntry
->bUsed
)
867 if(pstClassifierEntry
->ulSFID
!= Adapter
->PackInfo
[uiLoopIndex
].ulSFID
)
870 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"\tDumping Classifier Rule Entry For Index: %X Classifier Rule ID : %X\n",uiClsfrIndex
,pstClassifierEntry
->uiClassifierRuleIndex
);
871 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"\tDumping Classifier Rule Entry For Index: %X usVCID_Value : %X\n",uiClsfrIndex
,pstClassifierEntry
->usVCID_Value
);
872 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"\tDumping Classifier Rule Entry For Index: %X bProtocolValid : %X\n",uiClsfrIndex
,pstClassifierEntry
->bProtocolValid
);
873 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"\tDumping Classifier Rule Entry For Index: %X bTOSValid : %X\n",uiClsfrIndex
,pstClassifierEntry
->bTOSValid
);
874 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"\tDumping Classifier Rule Entry For Index: %X bDestIpValid : %X\n",uiClsfrIndex
,pstClassifierEntry
->bDestIpValid
);
875 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"\tDumping Classifier Rule Entry For Index: %X bSrcIpValid : %X\n",uiClsfrIndex
,pstClassifierEntry
->bSrcIpValid
);
878 for(uiIndex
=0;uiIndex
<MAX_PORT_RANGE
;uiIndex
++)
880 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"\tusSrcPortRangeLo:%X\n",pstClassifierEntry
->usSrcPortRangeLo
[uiIndex
]);
881 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"\tusSrcPortRangeHi:%X\n",pstClassifierEntry
->usSrcPortRangeHi
[uiIndex
]);
882 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"\tusDestPortRangeLo:%X\n",pstClassifierEntry
->usDestPortRangeLo
[uiIndex
]);
883 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"\tusDestPortRangeHi:%X\n",pstClassifierEntry
->usDestPortRangeHi
[uiIndex
]);
886 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
," \tucIPSourceAddressLength : 0x%x\n",pstClassifierEntry
->ucIPSourceAddressLength
);
887 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"\tucIPDestinationAddressLength : 0x%x\n",pstClassifierEntry
->ucIPDestinationAddressLength
);
888 for(uiIndex
=0;uiIndex
<pstClassifierEntry
->ucIPSourceAddressLength
;uiIndex
++)
890 if(Adapter
->PackInfo
[uiLoopIndex
].ucIpVersion
== IPV6
)
892 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"\tIpv6 ulSrcIpAddr :\n");
893 DumpIpv6Address(pstClassifierEntry
->stSrcIpAddress
.ulIpv6Addr
);
894 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"\tIpv6 ulSrcIpMask :\n");
895 DumpIpv6Address(pstClassifierEntry
->stSrcIpAddress
.ulIpv6Mask
);
899 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"\tulSrcIpAddr:%lX\n",pstClassifierEntry
->stSrcIpAddress
.ulIpv4Addr
[uiIndex
]);
900 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"\tulSrcIpMask:%lX\n",pstClassifierEntry
->stSrcIpAddress
.ulIpv4Mask
[uiIndex
]);
903 for(uiIndex
=0;uiIndex
<pstClassifierEntry
->ucIPDestinationAddressLength
;uiIndex
++)
905 if(Adapter
->PackInfo
[uiLoopIndex
].ucIpVersion
== IPV6
)
907 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"\tIpv6 ulDestIpAddr :\n");
908 DumpIpv6Address(pstClassifierEntry
->stDestIpAddress
.ulIpv6Addr
);
909 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"\tIpv6 ulDestIpMask :\n");
910 DumpIpv6Address(pstClassifierEntry
->stDestIpAddress
.ulIpv6Mask
);
915 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"\tulDestIpAddr:%lX\n",pstClassifierEntry
->stDestIpAddress
.ulIpv4Addr
[uiIndex
]);
916 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"\tulDestIpMask:%lX\n",pstClassifierEntry
->stDestIpAddress
.ulIpv4Mask
[uiIndex
]);
919 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"\tucProtocol:0x%X\n",pstClassifierEntry
->ucProtocol
[0]);
920 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"\tu8ClassifierRulePriority:%X\n",pstClassifierEntry
->u8ClassifierRulePriority
);
924 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"ulSFID:%lX\n",Adapter
->PackInfo
[uiLoopIndex
].ulSFID
);
925 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"usVCID_Value:%X\n",Adapter
->PackInfo
[uiLoopIndex
].usVCID_Value
);
926 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"PhsEnabled: 0x%X\n",Adapter
->PackInfo
[uiLoopIndex
].bHeaderSuppressionEnabled
);
927 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"uiThreshold:%X\n",Adapter
->PackInfo
[uiLoopIndex
].uiThreshold
);
930 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"bValid:%X\n",Adapter
->PackInfo
[uiLoopIndex
].bValid
);
931 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"bActive:%X\n",Adapter
->PackInfo
[uiLoopIndex
].bActive
);
932 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"ActivateReqSent: %x", Adapter
->PackInfo
[uiLoopIndex
].bActivateRequestSent
);
933 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"u8QueueType:%X\n",Adapter
->PackInfo
[uiLoopIndex
].u8QueueType
);
934 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"uiMaxBucketSize:%X\n",Adapter
->PackInfo
[uiLoopIndex
].uiMaxBucketSize
);
935 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"uiPerSFTxResourceCount:%X\n",atomic_read(&Adapter
->PackInfo
[uiLoopIndex
].uiPerSFTxResourceCount
));
936 //DumpDebug(DUMP_INFO,(" bCSSupport:%X\n",Adapter->PackInfo[uiLoopIndex].bCSSupport));
937 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"CurrQueueDepthOnTarget: %x\n", Adapter
->PackInfo
[uiLoopIndex
].uiCurrentQueueDepthOnTarget
);
938 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"uiCurrentBytesOnHost:%X\n",Adapter
->PackInfo
[uiLoopIndex
].uiCurrentBytesOnHost
);
939 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"uiCurrentPacketsOnHost:%X\n",Adapter
->PackInfo
[uiLoopIndex
].uiCurrentPacketsOnHost
);
940 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"uiDroppedCountBytes:%X\n",Adapter
->PackInfo
[uiLoopIndex
].uiDroppedCountBytes
);
941 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"uiDroppedCountPackets:%X\n",Adapter
->PackInfo
[uiLoopIndex
].uiDroppedCountPackets
);
942 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"uiSentBytes:%X\n",Adapter
->PackInfo
[uiLoopIndex
].uiSentBytes
);
943 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"uiSentPackets:%X\n",Adapter
->PackInfo
[uiLoopIndex
].uiSentPackets
);
944 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"uiCurrentDrainRate:%X\n",Adapter
->PackInfo
[uiLoopIndex
].uiCurrentDrainRate
);
945 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"uiThisPeriodSentBytes:%X\n",Adapter
->PackInfo
[uiLoopIndex
].uiThisPeriodSentBytes
);
946 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"liDrainCalculated:%llX\n",Adapter
->PackInfo
[uiLoopIndex
].liDrainCalculated
);
947 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"uiCurrentTokenCount:%X\n",Adapter
->PackInfo
[uiLoopIndex
].uiCurrentTokenCount
);
948 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"liLastUpdateTokenAt:%llX\n",Adapter
->PackInfo
[uiLoopIndex
].liLastUpdateTokenAt
);
949 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"uiMaxAllowedRate:%X\n",Adapter
->PackInfo
[uiLoopIndex
].uiMaxAllowedRate
);
950 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"uiPendedLast:%X\n",Adapter
->PackInfo
[uiLoopIndex
].uiPendedLast
);
951 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"NumOfPacketsSent:%X\n",Adapter
->PackInfo
[uiLoopIndex
].NumOfPacketsSent
);
952 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
, "Direction: %x\n", Adapter
->PackInfo
[uiLoopIndex
].ucDirection
);
953 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
, "CID: %x\n", Adapter
->PackInfo
[uiLoopIndex
].usCID
);
954 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
, "ProtocolValid: %x\n", Adapter
->PackInfo
[uiLoopIndex
].bProtocolValid
);
955 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
, "TOSValid: %x\n", Adapter
->PackInfo
[uiLoopIndex
].bTOSValid
);
956 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
, "DestIpValid: %x\n", Adapter
->PackInfo
[uiLoopIndex
].bDestIpValid
);
957 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
, "SrcIpValid: %x\n", Adapter
->PackInfo
[uiLoopIndex
].bSrcIpValid
);
958 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
, "ActiveSet: %x\n", Adapter
->PackInfo
[uiLoopIndex
].bActiveSet
);
959 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
, "AdmittedSet: %x\n", Adapter
->PackInfo
[uiLoopIndex
].bAdmittedSet
);
960 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
, "AuthzSet: %x\n", Adapter
->PackInfo
[uiLoopIndex
].bAuthorizedSet
);
961 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
, "ClassifyPrority: %x\n", Adapter
->PackInfo
[uiLoopIndex
].bClassifierPriority
);
962 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
, "uiMaxLatency: %x\n",Adapter
->PackInfo
[uiLoopIndex
].uiMaxLatency
);
963 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
, "ServiceClassName: %x %x %x %x\n",Adapter
->PackInfo
[uiLoopIndex
].ucServiceClassName
[0],Adapter
->PackInfo
[uiLoopIndex
].ucServiceClassName
[1],Adapter
->PackInfo
[uiLoopIndex
].ucServiceClassName
[2],Adapter
->PackInfo
[uiLoopIndex
].ucServiceClassName
[3]);
964 // BCM_DEBUG_PRINT (Adapter, DBG_TYPE_OTHERS, DUMP_INFO, DBG_LVL_ALL, "bHeaderSuppressionEnabled :%X\n", Adapter->PackInfo[uiLoopIndex].bHeaderSuppressionEnabled);
965 // BCM_DEBUG_PRINT (Adapter, DBG_TYPE_OTHERS, DUMP_INFO, DBG_LVL_ALL, "uiTotalTxBytes:%X\n", Adapter->PackInfo[uiLoopIndex].uiTotalTxBytes);
966 // BCM_DEBUG_PRINT (Adapter, DBG_TYPE_OTHERS, DUMP_INFO, DBG_LVL_ALL, "uiTotalRxBytes:%X\n", Adapter->PackInfo[uiLoopIndex].uiTotalRxBytes);
967 // DumpDebug(DUMP_INFO,(" uiRanOutOfResCount:%X\n",Adapter->PackInfo[uiLoopIndex].uiRanOutOfResCount));
970 for(uiLoopIndex
= 0 ; uiLoopIndex
< MIBS_MAX_HIST_ENTRIES
; uiLoopIndex
++)
971 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"Adapter->aRxPktSizeHist[%x] = %x\n",uiLoopIndex
,Adapter
->aRxPktSizeHist
[uiLoopIndex
]);
973 for(uiLoopIndex
= 0 ; uiLoopIndex
< MIBS_MAX_HIST_ENTRIES
; uiLoopIndex
++)
974 BCM_DEBUG_PRINT (Adapter
, DBG_TYPE_OTHERS
, DUMP_INFO
, DBG_LVL_ALL
,"Adapter->aTxPktSizeHist[%x] = %x\n",uiLoopIndex
,Adapter
->aTxPktSizeHist
[uiLoopIndex
]);
984 __inline
int reset_card_proc(PMINI_ADAPTER ps_adapter
)
986 int retval
= STATUS_SUCCESS
;
988 #ifndef BCM_SHM_INTERFACE
989 PMINI_ADAPTER Adapter
= GET_BCM_ADAPTER(gblpnetdev
);
990 PS_INTERFACE_ADAPTER psIntfAdapter
= NULL
;
991 unsigned int value
= 0, uiResetValue
= 0;
993 psIntfAdapter
= ((PS_INTERFACE_ADAPTER
)(ps_adapter
->pvInterfaceAdapter
)) ;
995 ps_adapter
->bDDRInitDone
= FALSE
;
997 if(ps_adapter
->chip_id
>= T3LPB
)
999 //SYS_CFG register is write protected hence for modifying this reg value, it should be read twice before
1000 rdmalt(ps_adapter
,SYS_CFG
, &value
, sizeof(value
));
1001 rdmalt(ps_adapter
,SYS_CFG
, &value
, sizeof(value
));
1003 //making bit[6...5] same as was before f/w download. this setting force the h/w to
1004 //re-populated the SP RAM area with the string descriptor .
1005 value
= value
| (ps_adapter
->syscfgBefFwDld
& 0x00000060) ;
1006 wrmalt(ps_adapter
, SYS_CFG
, &value
, sizeof(value
));
1009 #ifndef BCM_SHM_INTERFACE
1010 //killing all submitted URBs.
1011 psIntfAdapter
->psAdapter
->StopAllXaction
= TRUE
;
1012 Bcm_kill_all_URBs(psIntfAdapter
);
1014 /* Reset the UMA-B Device */
1015 if(ps_adapter
->chip_id
>= T3LPB
)
1017 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0, "Reseting UMA-B \n");
1018 retval
= usb_reset_device(psIntfAdapter
->udev
);
1020 psIntfAdapter
->psAdapter
->StopAllXaction
= FALSE
;
1022 if(retval
!= STATUS_SUCCESS
)
1024 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0, "Reset failed with ret value :%d", retval
);
1027 if (ps_adapter
->chip_id
== BCS220_2
||
1028 ps_adapter
->chip_id
== BCS220_2BC
||
1029 ps_adapter
->chip_id
== BCS250_BC
||
1030 ps_adapter
->chip_id
== BCS220_3
)
1032 retval
= rdmalt(ps_adapter
,HPM_CONFIG_LDO145
, &value
, sizeof(value
));
1035 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"read failed with status :%d",retval
);
1040 retval
= wrmalt(ps_adapter
, HPM_CONFIG_LDO145
, &value
, sizeof(value
));
1043 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"write failed with status :%d",retval
);
1051 retval
= rdmalt(ps_adapter
,0x0f007018, &value
, sizeof(value
));
1053 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"read failed with status :%d",retval
);
1057 retval
= wrmalt(ps_adapter
, 0x0f007018, &value
, sizeof(value
)) ;
1059 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"write failed with status :%d",retval
);
1063 // Toggling the GPIO 8, 9
1065 retval
= wrmalt(ps_adapter
, GPIO_OUTPUT_REGISTER
, &value
, sizeof(value
));
1067 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"write failed with status :%d",retval
);
1071 retval
= wrmalt(ps_adapter
, GPIO_MODE_REGISTER
, &value
, sizeof(value
)) ;
1073 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"write failed with status :%d",retval
);
1079 //ps_adapter->downloadDDR = false;
1081 if(ps_adapter
->bFlashBoot
)
1083 //In flash boot mode MIPS state register has reverse polarity.
1084 // So just or with setting bit 30.
1085 //Make the MIPS in Reset state.
1086 rdmalt(ps_adapter
, CLOCK_RESET_CNTRL_REG_1
, &uiResetValue
, sizeof(uiResetValue
));
1088 uiResetValue
|=(1<<30);
1089 wrmalt(ps_adapter
, CLOCK_RESET_CNTRL_REG_1
, &uiResetValue
, sizeof(uiResetValue
));
1092 if(ps_adapter
->chip_id
>= T3LPB
)
1096 // WA for SYSConfig Issue.
1097 // Read SYSCFG Twice to make it writable.
1099 rdmalt(ps_adapter
, SYS_CFG
, &uiResetValue
, sizeof(uiResetValue
));
1100 if(uiResetValue
& (1<<4))
1103 rdmalt(ps_adapter
, SYS_CFG
, &uiResetValue
, sizeof(uiResetValue
));//2nd read to make it writable.
1104 uiResetValue
&= (~(1<<4));
1105 wrmalt(ps_adapter
,SYS_CFG
, &uiResetValue
, sizeof(uiResetValue
));
1110 wrmalt(ps_adapter
, 0x0f01186c, &uiResetValue
, sizeof(uiResetValue
));
1113 psIntfAdapter
->psAdapter
->StopAllXaction
= FALSE
;
1118 __inline
int run_card_proc(PMINI_ADAPTER ps_adapter
)
1120 unsigned int value
=0;
1123 if(rdmalt(ps_adapter
, CLOCK_RESET_CNTRL_REG_1
, &value
, sizeof(value
)) < 0) {
1124 BCM_DEBUG_PRINT(ps_adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
,"%s:%d\n", __FUNCTION__
, __LINE__
);
1125 return STATUS_FAILURE
;
1128 if(ps_adapter
->bFlashBoot
)
1138 if(wrmalt(ps_adapter
, CLOCK_RESET_CNTRL_REG_1
, &value
, sizeof(value
)) < 0) {
1139 BCM_DEBUG_PRINT(ps_adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
,"%s:%d\n", __FUNCTION__
, __LINE__
);
1140 return STATUS_FAILURE
;
1143 return STATUS_SUCCESS
;
1146 int InitCardAndDownloadFirmware(PMINI_ADAPTER ps_adapter
)
1149 UINT status
= STATUS_SUCCESS
;
1151 #ifdef BCM_SHM_INTERFACE
1152 unsigned char *pConfigFileAddr
= (unsigned char *)CPE_MACXVI_CFG_ADDR
;
1155 * Create the threads first and then download the
1156 * Firm/DDR Settings..
1159 if((status
= create_worker_threads(ps_adapter
))<0)
1161 BCM_DEBUG_PRINT(ps_adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "Cannot create thread");
1165 * For Downloading the Firm, parse the cfg file first.
1167 status
= bcm_parse_target_params (ps_adapter
);
1172 #ifndef BCM_SHM_INTERFACE
1173 if(ps_adapter
->chip_id
>= T3LPB
)
1175 rdmalt(ps_adapter
, SYS_CFG
, &value
, sizeof (value
));
1176 ps_adapter
->syscfgBefFwDld
= value
;
1177 if((value
& 0x60)== 0)
1179 ps_adapter
->bFlashBoot
= TRUE
;
1183 reset_card_proc(ps_adapter
);
1185 //Initializing the NVM.
1186 BcmInitNVM(ps_adapter
);
1187 status
= ddr_init(ps_adapter
);
1190 BCM_DEBUG_PRINT (ps_adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "ddr_init Failed\n");
1194 /* Download cfg file */
1195 status
= buffDnldVerify(ps_adapter
,
1196 (PUCHAR
)ps_adapter
->pstargetparams
,
1197 sizeof(STARGETPARAMS
),
1201 BCM_DEBUG_PRINT(ps_adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "Error downloading CFG file");
1204 BCM_DEBUG_PRINT(ps_adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "CFG file downloaded");
1206 if(register_networkdev(ps_adapter
))
1208 BCM_DEBUG_PRINT(ps_adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "Register Netdevice failed. Cleanup needs to be performed.");
1212 if(FALSE
== ps_adapter
->AutoFirmDld
)
1214 BCM_DEBUG_PRINT(ps_adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "AutoFirmDld Disabled in CFG File..\n");
1215 //If Auto f/w download is disable, register the control interface,
1216 //register the control interface after the mailbox.
1217 if(register_control_device_interface(ps_adapter
) < 0)
1219 BCM_DEBUG_PRINT(ps_adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "Register Control Device failed. Cleanup needs to be performed.");
1223 return STATUS_SUCCESS
;
1227 * Do the LED Settings here. It will be used by the Firmware Download
1232 * 1. If the LED Settings fails, do not stop and do the Firmware download.
1233 * 2. This init would happend only if the cfg file is present, else
1234 * call from the ioctl context.
1237 status
= InitLedSettings (ps_adapter
);
1241 BCM_DEBUG_PRINT(ps_adapter
,DBG_TYPE_PRINTK
, 0, 0,"INIT LED FAILED\n");
1244 if(ps_adapter
->LEDInfo
.led_thread_running
& BCM_LED_THREAD_RUNNING_ACTIVELY
)
1246 ps_adapter
->DriverState
= DRIVER_INIT
;
1247 wake_up(&ps_adapter
->LEDInfo
.notify_led_event
);
1250 if(ps_adapter
->LEDInfo
.led_thread_running
& BCM_LED_THREAD_RUNNING_ACTIVELY
)
1252 ps_adapter
->DriverState
= FW_DOWNLOAD
;
1253 wake_up(&ps_adapter
->LEDInfo
.notify_led_event
);
1257 wrmalt(ps_adapter
, EEPROM_CAL_DATA_INTERNAL_LOC
- 4, &value
, sizeof(value
));
1258 wrmalt(ps_adapter
, EEPROM_CAL_DATA_INTERNAL_LOC
- 8, &value
, sizeof(value
));
1260 if(ps_adapter
->eNVMType
== NVM_FLASH
)
1262 status
= PropagateCalParamsFromFlashToMemory(ps_adapter
);
1265 BCM_DEBUG_PRINT(ps_adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
," Propogation of Cal param failed .." );
1270 else if(psAdapter
->eNVMType
== NVM_EEPROM
)
1272 PropagateCalParamsFromEEPROMToMemory();
1276 /* Download Firmare */
1277 if ((status
= BcmFileDownload( ps_adapter
, BIN_FILE
, FIRMWARE_BEGIN_ADDR
)))
1279 BCM_DEBUG_PRINT(ps_adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "No Firmware File is present... \n");
1283 BCM_DEBUG_PRINT(ps_adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "BIN file downloaded");
1284 status
= run_card_proc(ps_adapter
);
1287 BCM_DEBUG_PRINT (ps_adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "run_card_proc Failed\n");
1292 ps_adapter
->fw_download_done
= TRUE
;
1296 if(ps_adapter
->LEDInfo
.led_thread_running
& BCM_LED_THREAD_RUNNING_ACTIVELY
)
1298 ps_adapter
->DriverState
= FW_DOWNLOAD_DONE
;
1299 wake_up(&ps_adapter
->LEDInfo
.notify_led_event
);
1304 ps_adapter
->bDDRInitDone
= TRUE
;
1305 //Initializing the NVM.
1306 BcmInitNVM(ps_adapter
);
1308 //Propagating the cal param from Flash to DDR
1310 wrmalt(ps_adapter
, EEPROM_CAL_DATA_INTERNAL_LOC
- 4, &value
, sizeof(value
));
1311 wrmalt(ps_adapter
, EEPROM_CAL_DATA_INTERNAL_LOC
- 8, &value
, sizeof(value
));
1313 if(ps_adapter
->eNVMType
== NVM_FLASH
)
1315 status
= PropagateCalParamsFromFlashToMemory(ps_adapter
);
1318 printk("\nPropogation of Cal param from flash to DDR failed ..\n" );
1322 //Copy config file param to DDR.
1323 memcpy(pConfigFileAddr
,ps_adapter
->pstargetparams
, sizeof(STARGETPARAMS
));
1325 if(register_networkdev(ps_adapter
))
1327 BCM_DEBUG_PRINT(ps_adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "Register Netdevice failed. Cleanup needs to be performed.");
1332 status
= InitLedSettings (ps_adapter
);
1335 BCM_DEBUG_PRINT(ps_adapter
,DBG_TYPE_PRINTK
, 0, 0,"INIT LED FAILED\n");
1340 if(register_control_device_interface(ps_adapter
) < 0)
1342 BCM_DEBUG_PRINT(ps_adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "Register Control Device failed. Cleanup needs to be performed.");
1346 ps_adapter
->fw_download_done
= TRUE
;
1352 int bcm_parse_target_params(PMINI_ADAPTER Adapter
)
1354 #ifdef BCM_SHM_INTERFACE
1355 extern void read_cfg_file(PMINI_ADAPTER Adapter
);
1357 struct file
*flp
=NULL
;
1358 mm_segment_t oldfs
={0};
1363 buff
=(PCHAR
)kmalloc(BUFFER_1K
, GFP_KERNEL
);
1368 if((Adapter
->pstargetparams
=
1369 kmalloc(sizeof(STARGETPARAMS
), GFP_KERNEL
)) == NULL
)
1374 flp
=open_firmware_file(Adapter
, CFG_FILE
);
1376 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "NOT ABLE TO OPEN THE %s FILE \n", CFG_FILE
);
1378 bcm_kfree(Adapter
->pstargetparams
);
1379 Adapter
->pstargetparams
= NULL
;
1382 oldfs
=get_fs(); set_fs(get_ds());
1383 len
=vfs_read(flp
, (void __user __force
*)buff
, BUFFER_1K
, &pos
);
1386 if(len
!= sizeof(STARGETPARAMS
))
1388 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
,"Mismatch in Target Param Structure!\n");
1390 bcm_kfree(Adapter
->pstargetparams
);
1391 Adapter
->pstargetparams
= NULL
;
1392 filp_close(flp
, current
->files
);
1395 filp_close(flp
, current
->files
);
1397 /* Check for autolink in config params */
1399 * Values in Adapter->pstargetparams are in network byte order
1401 memcpy(Adapter
->pstargetparams
, buff
, sizeof(STARGETPARAMS
));
1403 beceem_parse_target_struct(Adapter
);
1404 #ifdef BCM_SHM_INTERFACE
1405 read_cfg_file(Adapter
);
1408 return STATUS_SUCCESS
;
1411 void beceem_parse_target_struct(PMINI_ADAPTER Adapter
)
1413 UINT uiHostDrvrCfg6
=0, uiEEPROMFlag
= 0;;
1415 if(ntohl(Adapter
->pstargetparams
->m_u32PhyParameter2
) & AUTO_SYNC_DISABLE
)
1417 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "AutoSyncup is Disabled\n");
1418 Adapter
->AutoSyncup
= FALSE
;
1422 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "AutoSyncup is Enabled\n");
1423 Adapter
->AutoSyncup
= TRUE
;
1425 if(ntohl(Adapter
->pstargetparams
->HostDrvrConfig6
) & AUTO_LINKUP_ENABLE
)
1427 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "Enabling autolink up");
1428 Adapter
->AutoLinkUp
= TRUE
;
1432 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "Disabling autolink up");
1433 Adapter
->AutoLinkUp
= FALSE
;
1435 // Setting the DDR Setting..
1436 Adapter
->DDRSetting
=
1437 (ntohl(Adapter
->pstargetparams
->HostDrvrConfig6
) >>8)&0x0F;
1438 Adapter
->ulPowerSaveMode
=
1439 (ntohl(Adapter
->pstargetparams
->HostDrvrConfig6
)>>12)&0x0F;
1441 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "DDR Setting: %x\n", Adapter
->DDRSetting
);
1442 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_INITEXIT
, MP_INIT
,DBG_LVL_ALL
, "Power Save Mode: %lx\n",
1443 Adapter
->ulPowerSaveMode
);
1444 if(ntohl(Adapter
->pstargetparams
->HostDrvrConfig6
) & AUTO_FIRM_DOWNLOAD
)
1446 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "Enabling Auto Firmware Download\n");
1447 Adapter
->AutoFirmDld
= TRUE
;
1451 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "Disabling Auto Firmware Download\n");
1452 Adapter
->AutoFirmDld
= FALSE
;
1454 uiHostDrvrCfg6
= ntohl(Adapter
->pstargetparams
->HostDrvrConfig6
);
1455 Adapter
->bMipsConfig
= (uiHostDrvrCfg6
>>20)&0x01;
1456 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
,"MIPSConfig : 0x%X\n",Adapter
->bMipsConfig
);
1457 //used for backward compatibility.
1458 Adapter
->bDPLLConfig
= (uiHostDrvrCfg6
>>19)&0x01;
1460 Adapter
->PmuMode
= (uiHostDrvrCfg6
>> 24 ) & 0x03;
1461 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "PMU MODE: %x", Adapter
->PmuMode
);
1463 if((uiHostDrvrCfg6
>> HOST_BUS_SUSPEND_BIT
) & (0x01))
1465 Adapter
->bDoSuspend
= TRUE
;
1466 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "Making DoSuspend TRUE as per configFile");
1469 uiEEPROMFlag
= ntohl(Adapter
->pstargetparams
->m_u32EEPROMFlag
);
1470 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
, "uiEEPROMFlag : 0x%X\n",uiEEPROMFlag
);
1471 Adapter
->eNVMType
= (NVM_TYPE
)((uiEEPROMFlag
>>4)&0x3);
1474 Adapter
->bStatusWrite
= (uiEEPROMFlag
>>6)&0x1;
1475 //printk(("bStatusWrite : 0x%X\n", Adapter->bStatusWrite));
1477 Adapter
->uiSectorSizeInCFG
= 1024*(0xFFFF & ntohl(Adapter
->pstargetparams
->HostDrvrConfig4
));
1478 //printk(("uiSectorSize : 0x%X\n", Adapter->uiSectorSizeInCFG));
1480 Adapter
->bSectorSizeOverride
=(bool) ((ntohl(Adapter
->pstargetparams
->HostDrvrConfig4
))>>16)&0x1;
1481 //printk(MP_INIT,("bSectorSizeOverride : 0x%X\n",Adapter->bSectorSizeOverride));
1483 if(ntohl(Adapter
->pstargetparams
->m_u32PowerSavingModeOptions
) &0x01)
1484 Adapter
->ulPowerSaveMode
= DEVICE_POWERSAVE_MODE_AS_PROTOCOL_IDLE_MODE
;
1485 //autocorrection part
1486 if(Adapter
->ulPowerSaveMode
!= DEVICE_POWERSAVE_MODE_AS_PROTOCOL_IDLE_MODE
)
1487 doPowerAutoCorrection(Adapter
);
1491 VOID
doPowerAutoCorrection(PMINI_ADAPTER psAdapter
)
1493 UINT reporting_mode
= 0;
1495 reporting_mode
= ntohl(psAdapter
->pstargetparams
->m_u32PowerSavingModeOptions
) &0x02 ;
1496 psAdapter
->bIsAutoCorrectEnabled
= !((char)(psAdapter
->ulPowerSaveMode
>> 3) & 0x1);
1498 if(reporting_mode
== TRUE
)
1500 BCM_DEBUG_PRINT(psAdapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
,"can't do suspen/resume as reporting mode is enable");
1501 psAdapter
->bDoSuspend
= FALSE
;
1504 if (psAdapter
->bIsAutoCorrectEnabled
&& (psAdapter
->chip_id
>= T3LPB
))
1506 //If reporting mode is enable, switch PMU to PMC
1508 if(reporting_mode
== FALSE
)
1510 psAdapter
->ulPowerSaveMode
= DEVICE_POWERSAVE_MODE_AS_PMU_SHUTDOWN
;
1511 psAdapter
->bDoSuspend
= TRUE
;
1512 BCM_DEBUG_PRINT(psAdapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
,"PMU selected ....");
1518 psAdapter
->ulPowerSaveMode
= DEVICE_POWERSAVE_MODE_AS_PMU_CLOCK_GATING
;
1519 psAdapter
->bDoSuspend
=FALSE
;
1520 BCM_DEBUG_PRINT(psAdapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
,"PMC selected..");
1524 //clearing space bit[15..12]
1525 psAdapter
->pstargetparams
->HostDrvrConfig6
&= ~(htonl((0xF << 12)));
1526 //placing the power save mode option
1527 psAdapter
->pstargetparams
->HostDrvrConfig6
|= htonl((psAdapter
->ulPowerSaveMode
<< 12));
1530 else if (psAdapter
->bIsAutoCorrectEnabled
== FALSE
)
1533 // remove the autocorrect disable bit set before dumping.
1534 psAdapter
->ulPowerSaveMode
&= ~(1 << 3);
1535 psAdapter
->pstargetparams
->HostDrvrConfig6
&= ~(htonl(1 << 15));
1536 BCM_DEBUG_PRINT(psAdapter
,DBG_TYPE_INITEXIT
, MP_INIT
, DBG_LVL_ALL
,"Using Forced User Choice: %lx\n", psAdapter
->ulPowerSaveMode
);
1541 static unsigned char *ReadMacAddrEEPROM(PMINI_ADAPTER Adapter
, ulong dwAddress
)
1543 unsigned char *pucmacaddr
= NULL
;
1544 int status
= 0, i
=0;
1545 unsigned int temp
=0;
1548 pucmacaddr
= (unsigned char *)kmalloc(MAC_ADDRESS_SIZE
, GFP_KERNEL
);
1551 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0, "No Buffers to Read the EEPROM Address\n");
1555 dwAddress
|= 0x5b000000;
1556 status
= wrmalt(Adapter
, EEPROM_COMMAND_Q_REG
,
1557 (PUINT
)&dwAddress
, sizeof(UINT
));
1558 if(status
!= STATUS_SUCCESS
)
1560 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0, "wrm Failed..\n");
1561 bcm_kfree(pucmacaddr
);
1565 for(i
=0;i
<MAC_ADDRESS_SIZE
;i
++)
1567 status
= rdmalt(Adapter
, EEPROM_READ_DATA_Q_REG
, &temp
,sizeof(temp
));
1568 if(status
!= STATUS_SUCCESS
)
1570 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0, "rdm Failed..\n");
1571 bcm_kfree(pucmacaddr
);
1575 pucmacaddr
[i
] = temp
& 0xff;
1576 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_INITEXIT
, DRV_ENTRY
, DBG_LVL_ALL
,"%x \n", pucmacaddr
[i
]);
1584 INT
ReadMacAddressFromEEPROM(PMINI_ADAPTER Adapter
)
1586 unsigned char *puMacAddr
= NULL
;
1589 puMacAddr
= ReadMacAddrEEPROM(Adapter
,0x200);
1592 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_TX
, NEXT_SEND
, DBG_LVL_ALL
, "Couldn't retrieve the Mac Address\n");
1593 return STATUS_FAILURE
;
1597 if((puMacAddr
[0] == 0x0 && puMacAddr
[1] == 0x0 &&
1598 puMacAddr
[2] == 0x0 && puMacAddr
[3] == 0x0 &&
1599 puMacAddr
[4] == 0x0 && puMacAddr
[5] == 0x0) ||
1600 (puMacAddr
[0] == 0xFF && puMacAddr
[1] == 0xFF &&
1601 puMacAddr
[2] == 0xFF && puMacAddr
[3] == 0xFF &&
1602 puMacAddr
[4] == 0xFF && puMacAddr
[5] == 0xFF))
1604 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_TX
, NEXT_SEND
, DBG_LVL_ALL
, "Invalid Mac Address\n");
1605 bcm_kfree(puMacAddr
);
1606 return STATUS_FAILURE
;
1608 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_TX
, NEXT_SEND
, DBG_LVL_ALL
, "The Mac Address received is: \n");
1609 memcpy(Adapter
->dev
->dev_addr
, puMacAddr
, MAC_ADDRESS_SIZE
);
1610 for(i
=0;i
<MAC_ADDRESS_SIZE
;i
++)
1612 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"%02x ", Adapter
->dev
->dev_addr
[i
]);
1614 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"\n");
1615 bcm_kfree(puMacAddr
);
1617 return STATUS_SUCCESS
;
1621 static void convertEndian(B_UINT8 rwFlag
, PUINT puiBuffer
, UINT uiByteCount
)
1625 if(RWM_WRITE
== rwFlag
) {
1626 for(uiIndex
=0; uiIndex
< (uiByteCount
/sizeof(UINT
)); uiIndex
++) {
1627 puiBuffer
[uiIndex
] = htonl(puiBuffer
[uiIndex
]);
1630 for(uiIndex
=0; uiIndex
< (uiByteCount
/sizeof(UINT
)); uiIndex
++) {
1631 puiBuffer
[uiIndex
] = ntohl(puiBuffer
[uiIndex
]);
1636 #define CACHE_ADDRESS_MASK 0x80000000
1637 #define UNCACHE_ADDRESS_MASK 0xa0000000
1639 int rdm(PMINI_ADAPTER Adapter
, UINT uiAddress
, PCHAR pucBuff
, size_t sSize
)
1643 #ifndef BCM_SHM_INTERFACE
1644 uiRetVal
= Adapter
->interface_rdm(Adapter
->pvInterfaceAdapter
,
1645 uiAddress
, pucBuff
, sSize
);
1652 uiRetVal
= STATUS_SUCCESS
;
1653 if(uiAddress
& 0x10000000) {
1654 // DDR Memory Access
1655 uiAddress
|= CACHE_ADDRESS_MASK
;
1656 memcpy(pucBuff
,(unsigned char *)uiAddress
,sSize
);
1659 // Register, SPRAM, Flash
1660 uiAddress
|= UNCACHE_ADDRESS_MASK
;
1661 if ((uiAddress
& FLASH_ADDR_MASK
) == (FLASH_CONTIGIOUS_START_ADDR_BCS350
& FLASH_ADDR_MASK
))
1663 #if defined(FLASH_DIRECT_ACCESS)
1664 memcpy(pucBuff
,(unsigned char *)uiAddress
,sSize
);
1666 printk("\nInvalid GSPI ACCESS :Addr :%#X", uiAddress
);
1667 uiRetVal
= STATUS_FAILURE
;
1670 else if(((unsigned int )uiAddress
& 0x3) ||
1671 ((unsigned int )pucBuff
& 0x3) ||
1672 ((unsigned int )sSize
& 0x3)) {
1673 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"rdmalt :unalligned register access uiAddress = %x,pucBuff = %x size = %x\n",(unsigned int )uiAddress
,(unsigned int )pucBuff
,(unsigned int )sSize
);
1674 uiRetVal
= STATUS_FAILURE
;
1677 for (indx
=0;indx
<sSize
;indx
+=4){
1678 *(PUINT
)(pucBuff
+ indx
) = *(PUINT
)(uiAddress
+ indx
);
1685 int wrm(PMINI_ADAPTER Adapter
, UINT uiAddress
, PCHAR pucBuff
, size_t sSize
)
1689 #ifndef BCM_SHM_INTERFACE
1690 iRetVal
= Adapter
->interface_wrm(Adapter
->pvInterfaceAdapter
,
1691 uiAddress
, pucBuff
, sSize
);
1695 if(uiAddress
& 0x10000000) {
1696 // DDR Memory Access
1697 uiAddress
|= CACHE_ADDRESS_MASK
;
1698 memcpy((unsigned char *)(uiAddress
),pucBuff
,sSize
);
1701 // Register, SPRAM, Flash
1702 uiAddress
|= UNCACHE_ADDRESS_MASK
;
1704 if(((unsigned int )uiAddress
& 0x3) ||
1705 ((unsigned int )pucBuff
& 0x3) ||
1706 ((unsigned int )sSize
& 0x3)) {
1707 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"wrmalt: unalligned register access uiAddress = %x,pucBuff = %x size = %x\n",(unsigned int )uiAddress
,(unsigned int )pucBuff
,(unsigned int )sSize
);
1708 iRetVal
= STATUS_FAILURE
;
1711 for (indx
=0;indx
<sSize
;indx
+=4) {
1712 *(PUINT
)(uiAddress
+ indx
) = *(PUINT
)(pucBuff
+ indx
);
1716 iRetVal
= STATUS_SUCCESS
;
1722 int wrmalt (PMINI_ADAPTER Adapter
, UINT uiAddress
, PUINT pucBuff
, size_t size
)
1724 convertEndian(RWM_WRITE
, pucBuff
, size
);
1725 return wrm(Adapter
, uiAddress
, (PUCHAR
)pucBuff
, size
);
1728 int rdmalt (PMINI_ADAPTER Adapter
, UINT uiAddress
, PUINT pucBuff
, size_t size
)
1732 uiRetVal
= rdm(Adapter
,uiAddress
,(PUCHAR
)pucBuff
,size
);
1733 convertEndian(RWM_READ
, (PUINT
)pucBuff
, size
);
1738 int rdmWithLock(PMINI_ADAPTER Adapter
, UINT uiAddress
, PCHAR pucBuff
, size_t sSize
)
1741 INT status
= STATUS_SUCCESS
;
1742 down(&Adapter
->rdmwrmsync
);
1744 if((Adapter
->IdleMode
== TRUE
) ||
1745 (Adapter
->bShutStatus
==TRUE
) ||
1746 (Adapter
->bPreparingForLowPowerMode
==TRUE
))
1752 status
= rdm(Adapter
, uiAddress
, pucBuff
, sSize
);
1755 up(&Adapter
->rdmwrmsync
);
1758 int wrmWithLock(PMINI_ADAPTER Adapter
, UINT uiAddress
, PCHAR pucBuff
, size_t sSize
)
1760 INT status
= STATUS_SUCCESS
;
1761 down(&Adapter
->rdmwrmsync
);
1763 if((Adapter
->IdleMode
== TRUE
) ||
1764 (Adapter
->bShutStatus
==TRUE
) ||
1765 (Adapter
->bPreparingForLowPowerMode
==TRUE
))
1771 status
=wrm(Adapter
, uiAddress
, pucBuff
, sSize
);
1774 up(&Adapter
->rdmwrmsync
);
1778 int wrmaltWithLock (PMINI_ADAPTER Adapter
, UINT uiAddress
, PUINT pucBuff
, size_t size
)
1780 int iRetVal
= STATUS_SUCCESS
;
1782 down(&Adapter
->rdmwrmsync
);
1784 if((Adapter
->IdleMode
== TRUE
) ||
1785 (Adapter
->bShutStatus
==TRUE
) ||
1786 (Adapter
->bPreparingForLowPowerMode
==TRUE
))
1792 iRetVal
= wrmalt(Adapter
,uiAddress
,pucBuff
,size
);
1795 up(&Adapter
->rdmwrmsync
);
1799 int rdmaltWithLock (PMINI_ADAPTER Adapter
, UINT uiAddress
, PUINT pucBuff
, size_t size
)
1801 INT uiRetVal
=STATUS_SUCCESS
;
1803 down(&Adapter
->rdmwrmsync
);
1805 if((Adapter
->IdleMode
== TRUE
) ||
1806 (Adapter
->bShutStatus
==TRUE
) ||
1807 (Adapter
->bPreparingForLowPowerMode
==TRUE
))
1813 uiRetVal
= rdmalt(Adapter
,uiAddress
, pucBuff
, size
);
1816 up(&Adapter
->rdmwrmsync
);
1821 static VOID
HandleShutDownModeWakeup(PMINI_ADAPTER Adapter
)
1823 int clear_abort_pattern
= 0,Status
= 0;
1824 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_OTHERS
, MP_SHUTDOWN
, DBG_LVL_ALL
, "====>\n");
1825 //target has woken up From Shut Down
1826 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_OTHERS
, MP_SHUTDOWN
, DBG_LVL_ALL
, "Clearing Shut Down Software abort pattern\n");
1827 Status
= wrmalt(Adapter
,SW_ABORT_IDLEMODE_LOC
, (PUINT
)&clear_abort_pattern
, sizeof(clear_abort_pattern
));
1830 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_OTHERS
, MP_SHUTDOWN
, DBG_LVL_ALL
,"WRM to SW_ABORT_IDLEMODE_LOC failed with err:%d", Status
);
1833 if(Adapter
->ulPowerSaveMode
!= DEVICE_POWERSAVE_MODE_AS_PROTOCOL_IDLE_MODE
)
1836 InterfaceHandleShutdownModeWakeup(Adapter
);
1839 if(Adapter
->LEDInfo
.led_thread_running
& BCM_LED_THREAD_RUNNING_ACTIVELY
)
1841 Adapter
->DriverState
= NO_NETWORK_ENTRY
;
1842 wake_up(&Adapter
->LEDInfo
.notify_led_event
);
1845 Adapter
->bTriedToWakeUpFromlowPowerMode
= FALSE
;
1846 Adapter
->bShutStatus
= FALSE
;
1847 wake_up(&Adapter
->lowpower_mode_wait_queue
);
1848 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_OTHERS
, MP_SHUTDOWN
, DBG_LVL_ALL
, "<====\n");
1851 static VOID
SendShutModeResponse(PMINI_ADAPTER Adapter
)
1853 CONTROL_MESSAGE stShutdownResponse
;
1854 UINT NVMAccess
= 0,lowPwrAbortMsg
= 0;
1857 memset (&stShutdownResponse
, 0, sizeof(CONTROL_MESSAGE
));
1858 stShutdownResponse
.Leader
.Status
= LINK_UP_CONTROL_REQ
;
1859 stShutdownResponse
.Leader
.PLength
= 8;//8 bytes;
1860 stShutdownResponse
.szData
[0] = LINK_UP_ACK
;
1861 stShutdownResponse
.szData
[1] = LINK_SHUTDOWN_REQ_FROM_FIRMWARE
;
1863 /*********************************
1865 ** if [ semaphore is available ]
1866 ** acquire semaphone and return value 0 ;
1868 ** return non-zero value ;
1870 ***********************************/
1872 NVMAccess
= down_trylock(&Adapter
->NVMRdmWrmLock
);
1874 lowPwrAbortMsg
= down_trylock(&Adapter
->LowPowerModeSync
);
1877 if(NVMAccess
|| lowPwrAbortMsg
|| atomic_read(&Adapter
->TotalPacketCount
))
1880 up(&Adapter
->NVMRdmWrmLock
);
1883 up(&Adapter
->LowPowerModeSync
);
1885 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_OTHERS
, MP_SHUTDOWN
, DBG_LVL_ALL
, "Device Access is going on NACK the Shut Down MODE\n");
1886 stShutdownResponse
.szData
[2] = SHUTDOWN_NACK_FROM_DRIVER
;//NACK- device access is going on.
1887 Adapter
->bPreparingForLowPowerMode
= FALSE
;
1891 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_OTHERS
, MP_SHUTDOWN
, DBG_LVL_ALL
, "Sending SHUTDOWN MODE ACK\n");
1892 stShutdownResponse
.szData
[2] = SHUTDOWN_ACK_FROM_DRIVER
;//ShutDown ACK
1894 /* Wait for the LED to TURN OFF before sending ACK response */
1895 if(Adapter
->LEDInfo
.led_thread_running
& BCM_LED_THREAD_RUNNING_ACTIVELY
)
1899 /* Wake the LED Thread with LOWPOWER_MODE_ENTER State */
1900 Adapter
->DriverState
= LOWPOWER_MODE_ENTER
;
1901 wake_up(&Adapter
->LEDInfo
.notify_led_event
);
1903 /* Wait for 1 SEC for LED to OFF */
1904 iRetVal
= wait_event_timeout(Adapter
->LEDInfo
.idleModeSyncEvent
,\
1905 Adapter
->LEDInfo
.bIdle_led_off
, msecs_to_jiffies(1000));
1907 /* If Timed Out to Sync IDLE MODE Enter, do IDLE mode Exit and Send NACK to device */
1910 stShutdownResponse
.szData
[1] = SHUTDOWN_NACK_FROM_DRIVER
;//NACK- device access is going on.
1912 Adapter
->DriverState
= NO_NETWORK_ENTRY
;
1913 wake_up(&Adapter
->LEDInfo
.notify_led_event
);
1917 if(stShutdownResponse
.szData
[2] == SHUTDOWN_ACK_FROM_DRIVER
)
1919 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_OTHERS
, MP_SHUTDOWN
, DBG_LVL_ALL
,"ACKING SHUTDOWN MODE !!!!!!!!!");
1920 down(&Adapter
->rdmwrmsync
);
1921 Adapter
->bPreparingForLowPowerMode
= TRUE
;
1922 up(&Adapter
->rdmwrmsync
);
1924 #ifndef BCM_SHM_INTERFACE
1925 if(Adapter
->bDoSuspend
== TRUE
)
1926 Bcm_kill_all_URBs((PS_INTERFACE_ADAPTER
)(Adapter
->pvInterfaceAdapter
));
1931 Adapter
->bPreparingForLowPowerMode
= FALSE
;
1935 up(&Adapter
->NVMRdmWrmLock
);
1938 up(&Adapter
->LowPowerModeSync
);
1940 Status
= CopyBufferToControlPacket(Adapter
,&stShutdownResponse
);
1941 if((Status
!= STATUS_SUCCESS
))
1943 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_OTHERS
, MP_SHUTDOWN
, DBG_LVL_ALL
,"fail to send the Idle mode Request \n");
1944 Adapter
->bPreparingForLowPowerMode
= FALSE
;
1946 #ifndef BCM_SHM_INTERFACE
1947 StartInterruptUrb((PS_INTERFACE_ADAPTER
)(Adapter
->pvInterfaceAdapter
));
1953 void HandleShutDownModeRequest(PMINI_ADAPTER Adapter
,PUCHAR pucBuffer
)
1955 B_UINT32 uiResetValue
= 0;
1957 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_OTHERS
, MP_SHUTDOWN
, DBG_LVL_ALL
, "====>\n");
1959 if(*(pucBuffer
+1) == COMPLETE_WAKE_UP_NOTIFICATION_FRM_FW
)
1961 HandleShutDownModeWakeup(Adapter
);
1963 else if(*(pucBuffer
+1) == LINK_SHUTDOWN_REQ_FROM_FIRMWARE
)
1965 //Target wants to go to Shut Down Mode
1966 //InterfacePrepareForShutdown(Adapter);
1967 if(Adapter
->chip_id
== BCS220_2
||
1968 Adapter
->chip_id
== BCS220_2BC
||
1969 Adapter
->chip_id
== BCS250_BC
||
1970 Adapter
->chip_id
== BCS220_3
)
1972 rdmalt(Adapter
,HPM_CONFIG_MSW
, &uiResetValue
, 4);
1973 uiResetValue
|= (1<<17);
1974 wrmalt(Adapter
, HPM_CONFIG_MSW
, &uiResetValue
, 4);
1977 SendShutModeResponse(Adapter
);
1978 BCM_DEBUG_PRINT (Adapter
,DBG_TYPE_OTHERS
, MP_SHUTDOWN
, DBG_LVL_ALL
,"ShutDownModeResponse:Notification received: Sending the response(Ack/Nack)\n");
1981 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_OTHERS
, MP_SHUTDOWN
, DBG_LVL_ALL
, "<====\n");
1986 VOID
ResetCounters(PMINI_ADAPTER Adapter
)
1989 beceem_protocol_reset(Adapter
);
1991 Adapter
->CurrNumRecvDescs
= 0;
1992 Adapter
->PrevNumRecvDescs
= 0;
1993 Adapter
->LinkUpStatus
= 0;
1994 Adapter
->LinkStatus
= 0;
1995 atomic_set(&Adapter
->cntrlpktCnt
,0);
1996 atomic_set (&Adapter
->TotalPacketCount
,0);
1997 Adapter
->fw_download_done
=FALSE
;
1998 Adapter
->LinkStatus
= 0;
1999 Adapter
->AutoLinkUp
= FALSE
;
2000 Adapter
->IdleMode
= FALSE
;
2001 Adapter
->bShutStatus
= FALSE
;
2004 S_CLASSIFIER_RULE
*GetFragIPClsEntry(PMINI_ADAPTER Adapter
,USHORT usIpIdentification
,ULONG SrcIP
)
2007 for(uiIndex
=0;uiIndex
<MAX_FRAGMENTEDIP_CLASSIFICATION_ENTRIES
;uiIndex
++)
2009 if((Adapter
->astFragmentedPktClassifierTable
[uiIndex
].bUsed
)&&
2010 (Adapter
->astFragmentedPktClassifierTable
[uiIndex
].usIpIdentification
== usIpIdentification
)&&
2011 (Adapter
->astFragmentedPktClassifierTable
[uiIndex
].ulSrcIpAddress
== SrcIP
)&&
2012 !Adapter
->astFragmentedPktClassifierTable
[uiIndex
].bOutOfOrderFragment
)
2013 return Adapter
->astFragmentedPktClassifierTable
[uiIndex
].pstMatchedClassifierEntry
;
2018 void AddFragIPClsEntry(PMINI_ADAPTER Adapter
,PS_FRAGMENTED_PACKET_INFO psFragPktInfo
)
2021 for(uiIndex
=0;uiIndex
<MAX_FRAGMENTEDIP_CLASSIFICATION_ENTRIES
;uiIndex
++)
2023 if(!Adapter
->astFragmentedPktClassifierTable
[uiIndex
].bUsed
)
2025 memcpy(&Adapter
->astFragmentedPktClassifierTable
[uiIndex
],psFragPktInfo
,sizeof(S_FRAGMENTED_PACKET_INFO
));
2032 void DelFragIPClsEntry(PMINI_ADAPTER Adapter
,USHORT usIpIdentification
,ULONG SrcIp
)
2035 for(uiIndex
=0;uiIndex
<MAX_FRAGMENTEDIP_CLASSIFICATION_ENTRIES
;uiIndex
++)
2037 if((Adapter
->astFragmentedPktClassifierTable
[uiIndex
].bUsed
)&&
2038 (Adapter
->astFragmentedPktClassifierTable
[uiIndex
].usIpIdentification
== usIpIdentification
)&&
2039 (Adapter
->astFragmentedPktClassifierTable
[uiIndex
].ulSrcIpAddress
== SrcIp
))
2040 memset(&Adapter
->astFragmentedPktClassifierTable
[uiIndex
],0,sizeof(S_FRAGMENTED_PACKET_INFO
));
2044 void update_per_cid_rx (PMINI_ADAPTER Adapter
)
2048 if((jiffies
- Adapter
->liDrainCalculated
) < XSECONDS
)
2051 for(qindex
= 0; qindex
< HiPriority
; qindex
++)
2053 if(Adapter
->PackInfo
[qindex
].ucDirection
== 0)
2055 Adapter
->PackInfo
[qindex
].uiCurrentRxRate
=
2056 (Adapter
->PackInfo
[qindex
].uiCurrentRxRate
+
2057 Adapter
->PackInfo
[qindex
].uiThisPeriodRxBytes
)/2;
2059 Adapter
->PackInfo
[qindex
].uiThisPeriodRxBytes
= 0;
2063 Adapter
->PackInfo
[qindex
].uiCurrentDrainRate
=
2064 (Adapter
->PackInfo
[qindex
].uiCurrentDrainRate
+
2065 Adapter
->PackInfo
[qindex
].uiThisPeriodSentBytes
)/2;
2067 Adapter
->PackInfo
[qindex
].uiThisPeriodSentBytes
=0;
2070 Adapter
->liDrainCalculated
=jiffies
;
2072 void update_per_sf_desc_cnts( PMINI_ADAPTER Adapter
)
2075 u32 uibuff
[MAX_TARGET_DSX_BUFFERS
];
2077 if(!atomic_read (&Adapter
->uiMBupdate
))
2080 #ifdef BCM_SHM_INTERFACE
2081 if(rdmalt(Adapter
, TARGET_SFID_TXDESC_MAP_LOC
, (PUINT
)uibuff
, sizeof(UINT
) * MAX_TARGET_DSX_BUFFERS
)<0)
2083 if(rdmaltWithLock(Adapter
, TARGET_SFID_TXDESC_MAP_LOC
, (PUINT
)uibuff
, sizeof(UINT
) * MAX_TARGET_DSX_BUFFERS
)<0)
2086 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0, "rdm failed\n");
2089 for(iIndex
= 0;iIndex
< HiPriority
; iIndex
++)
2091 if(Adapter
->PackInfo
[iIndex
].bValid
&& Adapter
->PackInfo
[iIndex
].ucDirection
)
2093 if(Adapter
->PackInfo
[iIndex
].usVCID_Value
< MAX_TARGET_DSX_BUFFERS
)
2095 atomic_set(&Adapter
->PackInfo
[iIndex
].uiPerSFTxResourceCount
, uibuff
[Adapter
->PackInfo
[iIndex
].usVCID_Value
]);
2099 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0, "Invalid VCID : %x \n",
2100 Adapter
->PackInfo
[iIndex
].usVCID_Value
);
2104 atomic_set (&Adapter
->uiMBupdate
, FALSE
);
2107 void flush_queue(PMINI_ADAPTER Adapter
, UINT iQIndex
)
2109 struct sk_buff
* PacketToDrop
=NULL
;
2110 struct net_device_stats
* netstats
=NULL
;
2112 netstats
= &((PLINUX_DEP_DATA
)Adapter
->pvOsDepData
)->netstats
;
2114 spin_lock_bh(&Adapter
->PackInfo
[iQIndex
].SFQueueLock
);
2116 while(Adapter
->PackInfo
[iQIndex
].FirstTxQueue
&&
2117 atomic_read(&Adapter
->TotalPacketCount
))
2119 PacketToDrop
= Adapter
->PackInfo
[iQIndex
].FirstTxQueue
;
2120 if(PacketToDrop
&& PacketToDrop
->len
)
2122 netstats
->tx_dropped
++;
2123 DEQUEUEPACKET(Adapter
->PackInfo
[iQIndex
].FirstTxQueue
, \
2124 Adapter
->PackInfo
[iQIndex
].LastTxQueue
);
2126 Adapter
->PackInfo
[iQIndex
].uiCurrentPacketsOnHost
--;
2127 Adapter
->PackInfo
[iQIndex
].uiCurrentBytesOnHost
-= PacketToDrop
->len
;
2129 //Adding dropped statistics
2130 Adapter
->PackInfo
[iQIndex
].uiDroppedCountBytes
+= PacketToDrop
->len
;
2131 Adapter
->PackInfo
[iQIndex
].uiDroppedCountPackets
++;
2133 bcm_kfree_skb(PacketToDrop
);
2134 atomic_dec(&Adapter
->TotalPacketCount
);
2135 atomic_inc(&Adapter
->TxDroppedPacketCount
);
2139 spin_unlock_bh(&Adapter
->PackInfo
[iQIndex
].SFQueueLock
);
2143 void beceem_protocol_reset (PMINI_ADAPTER Adapter
)
2147 if(NULL
!= Adapter
->dev
)
2149 netif_carrier_off(Adapter
->dev
);
2150 netif_stop_queue(Adapter
->dev
);
2153 Adapter
->IdleMode
= FALSE
;
2154 Adapter
->LinkUpStatus
= FALSE
;
2155 ClearTargetDSXBuffer(Adapter
,0, TRUE
);
2156 //Delete All Classifier Rules
2158 for(i
= 0;i
<HiPriority
;i
++)
2160 DeleteAllClassifiersForSF(Adapter
,i
);
2163 flush_all_queues(Adapter
);
2165 if(Adapter
->TimerActive
== TRUE
)
2166 Adapter
->TimerActive
= FALSE
;
2168 memset(Adapter
->astFragmentedPktClassifierTable
, 0,
2169 sizeof(S_FRAGMENTED_PACKET_INFO
) *
2170 MAX_FRAGMENTEDIP_CLASSIFICATION_ENTRIES
);
2172 for(i
= 0;i
<HiPriority
;i
++)
2174 //resetting only the first size (S_MIBS_SERVICEFLOW_TABLE) for the SF.
2175 // It is same between MIBs and SF.
2176 memset((PVOID
)&Adapter
->PackInfo
[i
],0,sizeof(S_MIBS_SERVICEFLOW_TABLE
));
2182 #ifdef BCM_SHM_INTERFACE
2185 #define GET_GTB_DIFF(start, end) \
2186 ( (start) < (end) )? ( (end) - (start) ) : ( ~0x0 - ( (start) - (end)) +1 )
2188 void usdelay ( unsigned int a
) {
2189 unsigned int start
= *(unsigned int *)0xaf8051b4;
2190 unsigned int end
= start
+1;
2191 unsigned int diff
= 0;
2194 end
= *(unsigned int *)0xaf8051b4;
2195 diff
= (GET_GTB_DIFF(start
,end
))/80;
2200 void read_cfg_file(PMINI_ADAPTER Adapter
) {
2203 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"Config File Version = 0x%x \n",Adapter
->pstargetparams
->m_u32CfgVersion
);
2204 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"Center Frequency = 0x%x \n",Adapter
->pstargetparams
->m_u32CenterFrequency
);
2205 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"Band A Scan = 0x%x \n",Adapter
->pstargetparams
->m_u32BandAScan
);
2206 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"Band B Scan = 0x%x \n",Adapter
->pstargetparams
->m_u32BandBScan
);
2207 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"Band C Scan = 0x%x \n",Adapter
->pstargetparams
->m_u32BandCScan
);
2208 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"ERTPS Options = 0x%x \n",Adapter
->pstargetparams
->m_u32ErtpsOptions
);
2209 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"PHS Enable = 0x%x \n",Adapter
->pstargetparams
->m_u32PHSEnable
);
2210 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"Handoff Enable = 0x%x \n",Adapter
->pstargetparams
->m_u32HoEnable
);
2211 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"HO Reserved1 = 0x%x \n",Adapter
->pstargetparams
->m_u32HoReserved1
);
2212 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"HO Reserved2 = 0x%x \n",Adapter
->pstargetparams
->m_u32HoReserved2
);
2213 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"MIMO Enable = 0x%x \n",Adapter
->pstargetparams
->m_u32MimoEnable
);
2214 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"PKMv2 Enable = 0x%x \n",Adapter
->pstargetparams
->m_u32SecurityEnable
);
2215 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"Powersaving Modes Enable = 0x%x \n",Adapter
->pstargetparams
->m_u32PowerSavingModesEnable
);
2216 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"Power Saving Mode Options = 0x%x \n",Adapter
->pstargetparams
->m_u32PowerSavingModeOptions
);
2217 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"ARQ Enable = 0x%x \n",Adapter
->pstargetparams
->m_u32ArqEnable
);
2218 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"Harq Enable = 0x%x \n",Adapter
->pstargetparams
->m_u32HarqEnable
);
2219 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"EEPROM Flag = 0x%x \n",Adapter
->pstargetparams
->m_u32EEPROMFlag
);
2220 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"Customize = 0x%x \n",Adapter
->pstargetparams
->m_u32Customize
);
2221 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"Bandwidth = 0x%x \n",Adapter
->pstargetparams
->m_u32ConfigBW
);
2222 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"ShutDown Timer Value = 0x%x \n",Adapter
->pstargetparams
->m_u32ShutDownInitThresholdTimer
);
2223 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"RadioParameter = 0x%x \n",Adapter
->pstargetparams
->m_u32RadioParameter
);
2224 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"PhyParameter1 = 0x%x \n",Adapter
->pstargetparams
->m_u32PhyParameter1
);
2225 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"PhyParameter2 = 0x%x \n",Adapter
->pstargetparams
->m_u32PhyParameter2
);
2226 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"PhyParameter3 = 0x%x \n",Adapter
->pstargetparams
->m_u32PhyParameter3
);
2227 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"m_u32TestOptions = 0x%x \n",Adapter
->pstargetparams
->m_u32TestOptions
);
2228 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"MaxMACDataperDLFrame = 0x%x \n",Adapter
->pstargetparams
->m_u32MaxMACDataperDLFrame
);
2229 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"MaxMACDataperULFrame = 0x%x \n",Adapter
->pstargetparams
->m_u32MaxMACDataperULFrame
);
2230 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"Corr2MacFlags = 0x%x \n",Adapter
->pstargetparams
->m_u32Corr2MacFlags
);
2231 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"HostDrvrConfig1 = 0x%x \n",Adapter
->pstargetparams
->HostDrvrConfig1
);
2232 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"HostDrvrConfig2 = 0x%x \n",Adapter
->pstargetparams
->HostDrvrConfig2
);
2233 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"HostDrvrConfig3 = 0x%x \n",Adapter
->pstargetparams
->HostDrvrConfig3
);
2234 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"HostDrvrConfig4 = 0x%x \n",Adapter
->pstargetparams
->HostDrvrConfig4
);
2235 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"HostDrvrConfig5 = 0x%x \n",Adapter
->pstargetparams
->HostDrvrConfig5
);
2236 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"HostDrvrConfig6 = 0x%x \n",Adapter
->pstargetparams
->HostDrvrConfig6
);
2237 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"Segmented PUSC Enable = 0x%x \n",Adapter
->pstargetparams
->m_u32SegmentedPUSCenable
);
2238 BCM_DEBUG_PRINT(Adapter
,DBG_TYPE_PRINTK
, 0, 0,"BamcEnable = 0x%x \n",Adapter
->pstargetparams
->m_u32BandAMCEnable
);