13 for (uiLoopIndex = 0; uiLoopIndex <
NO_OF_QUEUES-1; uiLoopIndex++) {
16 Adapter->
PackInfo[uiLoopIndex].uiMaxBucketSize = 20*1024*1024;
33 if (psAdapter ==
NULL) {
58 default_wimax_protocol_initialize(psAdapter);
99 beceem_protocol_reset(Adapter);
162 pr_err(
DRV_NAME "Unable To Open File %s, err %ld", path, PTR_ERR(flp));
177 static int BcmFileDownload(
struct bcm_mini_adapter *Adapter,
const char *path,
unsigned int loc)
183 flp = open_firmware_file(Adapter, path);
223 unsigned char *ctrl_buff =
NULL;
332 if ((pLeader->
Status == 0x80) ||
406 if (!pstLinkRequest) {
421 if (!pstLinkRequest) {
432 if (pstLinkRequest) {
435 kfree(pstLinkRequest);
475 switch (*(pucBuffer+1)) {
480 beceem_protocol_reset(Adapter);
520 beceem_protocol_reset(Adapter);
526 HandleShutDownModeRequest(Adapter, pucBuffer);
534 PUCHAR puMacAddr = (pucBuffer + 1);
546 INT status = 0, NVMAccess = 0, lowPwrAbortMsg = 0;
549 memset(&tv, 0,
sizeof(tv));
645 UINT uiLoopIndex = 0;
647 UINT uiClsfrIndex = 0;
650 for (uiLoopIndex = 0; uiLoopIndex <
NO_OF_QUEUES; uiLoopIndex++) {
667 for (uiClsfrIndex = 0; uiClsfrIndex <
MAX_CLASSIFIERS; uiClsfrIndex++) {
669 if (!pstClassifierEntry->
bUsed)
672 if (pstClassifierEntry->
ulSFID != Adapter->
PackInfo[uiLoopIndex].ulSFID)
692 if (Adapter->
PackInfo[uiLoopIndex].ucIpVersion ==
IPV6) {
704 if (Adapter->
PackInfo[uiLoopIndex].ucIpVersion ==
IPV6) {
780 unsigned int value = 0, uiResetValue = 0;
831 bytes =
rdmalt(ps_adapter, 0x0f007018, &value,
sizeof(value));
838 retval =
wrmalt(ps_adapter, 0x0f007018, &value,
sizeof(value));
867 uiResetValue |= (1<<30);
877 rdmalt(ps_adapter,
SYS_CFG, &uiResetValue,
sizeof(uiResetValue));
878 if (uiResetValue & (1<<4)) {
880 rdmalt(ps_adapter,
SYS_CFG, &uiResetValue,
sizeof(uiResetValue));
881 uiResetValue &= (~(1<<4));
882 wrmalt(ps_adapter,
SYS_CFG, &uiResetValue,
sizeof(uiResetValue));
886 wrmalt(ps_adapter, 0x0f01186c, &uiResetValue,
sizeof(uiResetValue));
898 unsigned int value = 0;
928 status = create_worker_threads(ps_adapter);
932 status = bcm_parse_target_params(ps_adapter);
940 if ((value & 0x60) == 0)
1060 flp = open_firmware_file(Adapter,
CFG_FILE);
1091 UINT uiHostDrvrCfg6 = 0, uiEEPROMFlag = 0;
1125 Adapter->
PmuMode = (uiHostDrvrCfg6 >> 24) & 0x03;
1144 doPowerAutoCorrection(Adapter);
1149 UINT reporting_mode;
1154 if (reporting_mode ==
TRUE) {
1178 static void convertEndian(
B_UINT8 rwFlag,
PUINT puiBuffer,
UINT uiByteCount)
1183 for (uiIndex = 0; uiIndex < (uiByteCount/
sizeof(
UINT)); uiIndex++)
1184 puiBuffer[uiIndex] =
htonl(puiBuffer[uiIndex]);
1186 for (uiIndex = 0; uiIndex < (uiByteCount/
sizeof(
UINT)); uiIndex++)
1187 puiBuffer[uiIndex] =
ntohl(puiBuffer[uiIndex]);
1194 uiAddress, pucBuff, sSize);
1202 uiAddress, pucBuff, sSize);
1208 convertEndian(
RWM_WRITE, pucBuff, size);
1209 return wrm(Adapter, uiAddress, (
PUCHAR)pucBuff, size);
1216 uiRetVal =
rdm(Adapter, uiAddress, (
PUCHAR)pucBuff, size);
1235 status =
wrm(Adapter, uiAddress, pucBuff, sSize);
1255 iRetVal =
wrmalt(Adapter, uiAddress, pucBuff, size);
1274 uiRetVal =
rdmalt(Adapter, uiAddress, pucBuff, size);
1282 int clear_abort_pattern = 0,
Status = 0;
1312 UINT NVMAccess = 0, lowPwrAbortMsg = 0;
1317 stShutdownResponse.Leader.PLength = 8;
1337 if (!lowPwrAbortMsg)
1381 if (!lowPwrAbortMsg)
1400 HandleShutDownModeWakeup(Adapter);
1410 uiResetValue |= (1<<17);
1414 SendShutModeResponse(Adapter);
1424 beceem_protocol_reset(Adapter);
1482 for (qindex = 0; qindex <
HiPriority; qindex++) {
1483 if (Adapter->
PackInfo[qindex].ucDirection == 0) {
1484 Adapter->
PackInfo[qindex].uiCurrentRxRate =
1485 (Adapter->
PackInfo[qindex].uiCurrentRxRate +
1486 Adapter->
PackInfo[qindex].uiThisPeriodRxBytes) / 2;
1488 Adapter->
PackInfo[qindex].uiThisPeriodRxBytes = 0;
1490 Adapter->
PackInfo[qindex].uiCurrentDrainRate =
1491 (Adapter->
PackInfo[qindex].uiCurrentDrainRate +
1492 Adapter->
PackInfo[qindex].uiThisPeriodSentBytes) / 2;
1493 Adapter->
PackInfo[qindex].uiThisPeriodSentBytes = 0;
1514 for (iIndex = 0; iIndex <
HiPriority; iIndex++) {
1515 if (Adapter->
PackInfo[iIndex].bValid && Adapter->
PackInfo[iIndex].ucDirection) {
1516 if (Adapter->
PackInfo[iIndex].usVCID_Value < MAX_TARGET_DSX_BUFFERS)
1529 spin_lock_bh(&Adapter->
PackInfo[iQIndex].SFQueueLock);
1532 PacketToDrop = Adapter->
PackInfo[iQIndex].FirstTxQueue;
1533 if (PacketToDrop && PacketToDrop->
len) {
1536 Adapter->
PackInfo[iQIndex].uiCurrentPacketsOnHost--;
1537 Adapter->
PackInfo[iQIndex].uiCurrentBytesOnHost -= PacketToDrop->
len;
1540 Adapter->
PackInfo[iQIndex].uiDroppedCountBytes += PacketToDrop->
len;
1541 Adapter->
PackInfo[iQIndex].uiDroppedCountPackets++;
1542 dev_kfree_skb(PacketToDrop);
1546 spin_unlock_bh(&Adapter->
PackInfo[iQIndex].SFQueueLock);
1556 netif_stop_queue(Adapter->
dev);