CmHost.c 102 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358
  1. /************************************************************
  2. * CMHOST.C
  3. * This file contains the routines for handling Connection
  4. * Management.
  5. ************************************************************/
  6. //#define CONN_MSG
  7. #include "headers.h"
  8. typedef enum _E_CLASSIFIER_ACTION
  9. {
  10. eInvalidClassifierAction,
  11. eAddClassifier,
  12. eReplaceClassifier,
  13. eDeleteClassifier
  14. }E_CLASSIFIER_ACTION;
  15. static ULONG GetNextTargetBufferLocation(PMINI_ADAPTER Adapter,B_UINT16 tid);
  16. /************************************************************
  17. * Function - SearchSfid
  18. *
  19. * Description - This routinue would search QOS queues having
  20. * specified SFID as input parameter.
  21. *
  22. * Parameters - Adapter: Pointer to the Adapter structure
  23. * uiSfid : Given SFID for matching
  24. *
  25. * Returns - Queue index for this SFID(If matched)
  26. Else Invalid Queue Index(If Not matched)
  27. ************************************************************/
  28. INT SearchSfid(PMINI_ADAPTER Adapter,UINT uiSfid)
  29. {
  30. INT iIndex=0;
  31. for(iIndex=(NO_OF_QUEUES-1); iIndex>=0; iIndex--)
  32. if(Adapter->PackInfo[iIndex].ulSFID==uiSfid)
  33. return iIndex;
  34. return NO_OF_QUEUES+1;
  35. }
  36. /***************************************************************
  37. * Function - SearchFreeSfid
  38. *
  39. * Description - This routinue would search Free available SFID.
  40. *
  41. * Parameter - Adapter: Pointer to the Adapter structure
  42. *
  43. * Returns - Queue index for the free SFID
  44. * Else returns Invalid Index.
  45. ****************************************************************/
  46. static INT SearchFreeSfid(PMINI_ADAPTER Adapter)
  47. {
  48. UINT uiIndex=0;
  49. for(uiIndex=0; uiIndex < (NO_OF_QUEUES-1); uiIndex++)
  50. if(Adapter->PackInfo[uiIndex].ulSFID==0)
  51. return uiIndex;
  52. return NO_OF_QUEUES+1;
  53. }
  54. /*
  55. Function: SearchClsid
  56. Description: This routinue would search Classifier having specified ClassifierID as input parameter
  57. Input parameters: PMINI_ADAPTER Adapter - Adapter Context
  58. unsigned int uiSfid - The SF in which the classifier is to searched
  59. B_UINT16 uiClassifierID - The classifier ID to be searched
  60. Return: int :Classifier table index of matching entry
  61. */
  62. static int SearchClsid(PMINI_ADAPTER Adapter,ULONG ulSFID,B_UINT16 uiClassifierID)
  63. {
  64. unsigned int uiClassifierIndex = 0;
  65. for(uiClassifierIndex=0;uiClassifierIndex<MAX_CLASSIFIERS;uiClassifierIndex++)
  66. {
  67. if((Adapter->astClassifierTable[uiClassifierIndex].bUsed) &&
  68. (Adapter->astClassifierTable[uiClassifierIndex].uiClassifierRuleIndex == uiClassifierID)&&
  69. (Adapter->astClassifierTable[uiClassifierIndex].ulSFID == ulSFID))
  70. return uiClassifierIndex;
  71. }
  72. return MAX_CLASSIFIERS+1;
  73. }
  74. /**
  75. @ingroup ctrl_pkt_functions
  76. This routinue would search Free available Classifier entry in classifier table.
  77. @return free Classifier Entry index in classifier table for specified SF
  78. */
  79. static int SearchFreeClsid(PMINI_ADAPTER Adapter /**Adapter Context*/
  80. )
  81. {
  82. unsigned int uiClassifierIndex = 0;
  83. for(uiClassifierIndex=0;uiClassifierIndex<MAX_CLASSIFIERS;uiClassifierIndex++)
  84. {
  85. if(!Adapter->astClassifierTable[uiClassifierIndex].bUsed)
  86. return uiClassifierIndex;
  87. }
  88. return MAX_CLASSIFIERS+1;
  89. }
  90. static VOID deleteSFBySfid(PMINI_ADAPTER Adapter, UINT uiSearchRuleIndex)
  91. {
  92. //deleting all the packet held in the SF
  93. flush_queue(Adapter,uiSearchRuleIndex);
  94. //Deleting the all classifiers for this SF
  95. DeleteAllClassifiersForSF(Adapter,uiSearchRuleIndex);
  96. //Resetting only MIBS related entries in the SF
  97. memset((PVOID)&Adapter->PackInfo[uiSearchRuleIndex], 0, sizeof(S_MIBS_SERVICEFLOW_TABLE));
  98. }
  99. static inline VOID
  100. CopyIpAddrToClassifier(S_CLASSIFIER_RULE *pstClassifierEntry ,
  101. B_UINT8 u8IpAddressLen , B_UINT8 *pu8IpAddressMaskSrc ,
  102. BOOLEAN bIpVersion6 , E_IPADDR_CONTEXT eIpAddrContext)
  103. {
  104. UINT ucLoopIndex=0;
  105. UINT nSizeOfIPAddressInBytes = IP_LENGTH_OF_ADDRESS;
  106. UCHAR *ptrClassifierIpAddress = NULL;
  107. UCHAR *ptrClassifierIpMask = NULL;
  108. PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev);
  109. if(bIpVersion6)
  110. {
  111. nSizeOfIPAddressInBytes = IPV6_ADDRESS_SIZEINBYTES;
  112. }
  113. //Destination Ip Address
  114. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Ip Address Range Length:0x%X ",
  115. u8IpAddressLen);
  116. if((bIpVersion6?(IPV6_ADDRESS_SIZEINBYTES * MAX_IP_RANGE_LENGTH * 2):
  117. (TOTAL_MASKED_ADDRESS_IN_BYTES)) >= u8IpAddressLen)
  118. {
  119. /*
  120. //checking both the mask and address togethor in Classification.
  121. //So length will be : TotalLengthInBytes/nSizeOfIPAddressInBytes * 2
  122. //(nSizeOfIPAddressInBytes for address and nSizeOfIPAddressInBytes for mask)
  123. */
  124. if(eIpAddrContext == eDestIpAddress)
  125. {
  126. pstClassifierEntry->ucIPDestinationAddressLength =
  127. u8IpAddressLen/(nSizeOfIPAddressInBytes * 2);
  128. if(bIpVersion6)
  129. {
  130. ptrClassifierIpAddress =
  131. pstClassifierEntry->stDestIpAddress.ucIpv6Address;
  132. ptrClassifierIpMask =
  133. pstClassifierEntry->stDestIpAddress.ucIpv6Mask;
  134. }
  135. else
  136. {
  137. ptrClassifierIpAddress =
  138. pstClassifierEntry->stDestIpAddress.ucIpv4Address;
  139. ptrClassifierIpMask =
  140. pstClassifierEntry->stDestIpAddress.ucIpv4Mask;
  141. }
  142. }
  143. else if(eIpAddrContext == eSrcIpAddress)
  144. {
  145. pstClassifierEntry->ucIPSourceAddressLength =
  146. u8IpAddressLen/(nSizeOfIPAddressInBytes * 2);
  147. if(bIpVersion6)
  148. {
  149. ptrClassifierIpAddress =
  150. pstClassifierEntry->stSrcIpAddress.ucIpv6Address;
  151. ptrClassifierIpMask =
  152. pstClassifierEntry->stSrcIpAddress.ucIpv6Mask;
  153. }
  154. else
  155. {
  156. ptrClassifierIpAddress =
  157. pstClassifierEntry->stSrcIpAddress.ucIpv4Address;
  158. ptrClassifierIpMask =
  159. pstClassifierEntry->stSrcIpAddress.ucIpv4Mask;
  160. }
  161. }
  162. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Address Length:0x%X \n",
  163. pstClassifierEntry->ucIPDestinationAddressLength);
  164. while((u8IpAddressLen>= nSizeOfIPAddressInBytes) &&
  165. (ucLoopIndex < MAX_IP_RANGE_LENGTH))
  166. {
  167. memcpy(ptrClassifierIpAddress +
  168. (ucLoopIndex * nSizeOfIPAddressInBytes),
  169. (pu8IpAddressMaskSrc+(ucLoopIndex*nSizeOfIPAddressInBytes*2)),
  170. nSizeOfIPAddressInBytes);
  171. if(!bIpVersion6)
  172. {
  173. if(eIpAddrContext == eSrcIpAddress)
  174. {
  175. pstClassifierEntry->stSrcIpAddress.ulIpv4Addr[ucLoopIndex]=
  176. ntohl(pstClassifierEntry->stSrcIpAddress.
  177. ulIpv4Addr[ucLoopIndex]);
  178. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Src Ip Address:0x%luX ",pstClassifierEntry->stSrcIpAddress.ulIpv4Addr[ucLoopIndex]);
  179. }
  180. else if(eIpAddrContext == eDestIpAddress)
  181. {
  182. pstClassifierEntry->stDestIpAddress.ulIpv4Addr[ucLoopIndex]= ntohl(pstClassifierEntry->stDestIpAddress.
  183. ulIpv4Addr[ucLoopIndex]);
  184. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Dest Ip Address:0x%luX ",pstClassifierEntry->stDestIpAddress.ulIpv4Addr[ucLoopIndex]);
  185. }
  186. }
  187. u8IpAddressLen-=nSizeOfIPAddressInBytes;
  188. if(u8IpAddressLen >= nSizeOfIPAddressInBytes)
  189. {
  190. memcpy(ptrClassifierIpMask +
  191. (ucLoopIndex * nSizeOfIPAddressInBytes),
  192. (pu8IpAddressMaskSrc+nSizeOfIPAddressInBytes +
  193. (ucLoopIndex*nSizeOfIPAddressInBytes*2)),
  194. nSizeOfIPAddressInBytes);
  195. if(!bIpVersion6)
  196. {
  197. if(eIpAddrContext == eSrcIpAddress)
  198. {
  199. pstClassifierEntry->stSrcIpAddress.
  200. ulIpv4Mask[ucLoopIndex]=
  201. ntohl(pstClassifierEntry->stSrcIpAddress.
  202. ulIpv4Mask[ucLoopIndex]);
  203. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Src Ip Mask Address:0x%luX ",pstClassifierEntry->stSrcIpAddress.ulIpv4Mask[ucLoopIndex]);
  204. }
  205. else if(eIpAddrContext == eDestIpAddress)
  206. {
  207. pstClassifierEntry->stDestIpAddress.
  208. ulIpv4Mask[ucLoopIndex] =
  209. ntohl(pstClassifierEntry->stDestIpAddress.
  210. ulIpv4Mask[ucLoopIndex]);
  211. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Dest Ip Mask Address:0x%luX ",pstClassifierEntry->stDestIpAddress.ulIpv4Mask[ucLoopIndex]);
  212. }
  213. }
  214. u8IpAddressLen-=nSizeOfIPAddressInBytes;
  215. }
  216. if(0==u8IpAddressLen)
  217. {
  218. pstClassifierEntry->bDestIpValid=TRUE;
  219. }
  220. ucLoopIndex++;
  221. }
  222. if(bIpVersion6)
  223. {
  224. //Restore EndianNess of Struct
  225. for(ucLoopIndex =0 ; ucLoopIndex < MAX_IP_RANGE_LENGTH * 4 ;
  226. ucLoopIndex++)
  227. {
  228. if(eIpAddrContext == eSrcIpAddress)
  229. {
  230. pstClassifierEntry->stSrcIpAddress.ulIpv6Addr[ucLoopIndex]=
  231. ntohl(pstClassifierEntry->stSrcIpAddress.
  232. ulIpv6Addr[ucLoopIndex]);
  233. pstClassifierEntry->stSrcIpAddress.ulIpv6Mask[ucLoopIndex]= ntohl(pstClassifierEntry->stSrcIpAddress.
  234. ulIpv6Mask[ucLoopIndex]);
  235. }
  236. else if(eIpAddrContext == eDestIpAddress)
  237. {
  238. pstClassifierEntry->stDestIpAddress.ulIpv6Addr[ucLoopIndex]= ntohl(pstClassifierEntry->stDestIpAddress.
  239. ulIpv6Addr[ucLoopIndex]);
  240. pstClassifierEntry->stDestIpAddress.ulIpv6Mask[ucLoopIndex]= ntohl(pstClassifierEntry->stDestIpAddress.
  241. ulIpv6Mask[ucLoopIndex]);
  242. }
  243. }
  244. }
  245. }
  246. }
  247. void ClearTargetDSXBuffer(PMINI_ADAPTER Adapter,B_UINT16 TID,BOOLEAN bFreeAll)
  248. {
  249. ULONG ulIndex;
  250. for(ulIndex=0; ulIndex < Adapter->ulTotalTargetBuffersAvailable; ulIndex++)
  251. {
  252. if(Adapter->astTargetDsxBuffer[ulIndex].valid)
  253. continue;
  254. if ((bFreeAll) || (Adapter->astTargetDsxBuffer[ulIndex].tid == TID)){
  255. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "ClearTargetDSXBuffer: found tid %d buffer cleared %lx\n",
  256. TID, Adapter->astTargetDsxBuffer[ulIndex].ulTargetDsxBuffer);
  257. Adapter->astTargetDsxBuffer[ulIndex].valid=1;
  258. Adapter->astTargetDsxBuffer[ulIndex].tid=0;
  259. Adapter->ulFreeTargetBufferCnt++;
  260. }
  261. }
  262. }
  263. /**
  264. @ingroup ctrl_pkt_functions
  265. copy classifier rule into the specified SF index
  266. */
  267. static inline VOID CopyClassifierRuleToSF(PMINI_ADAPTER Adapter,stConvergenceSLTypes *psfCSType,UINT uiSearchRuleIndex,UINT nClassifierIndex)
  268. {
  269. S_CLASSIFIER_RULE *pstClassifierEntry = NULL;
  270. //VOID *pvPhsContext = NULL;
  271. UINT ucLoopIndex=0;
  272. //UCHAR ucProtocolLength=0;
  273. //ULONG ulPhsStatus;
  274. if(Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value == 0 ||
  275. nClassifierIndex > (MAX_CLASSIFIERS-1))
  276. return;
  277. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Storing Classifier Rule Index : %X",ntohs(psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex));
  278. if(nClassifierIndex > MAX_CLASSIFIERS-1)
  279. return;
  280. pstClassifierEntry = &Adapter->astClassifierTable[nClassifierIndex];
  281. if(pstClassifierEntry)
  282. {
  283. //Store if Ipv6
  284. pstClassifierEntry->bIpv6Protocol =
  285. (Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == IPV6)?TRUE:FALSE;
  286. //Destinaiton Port
  287. pstClassifierEntry->ucDestPortRangeLength=psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength/4;
  288. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Destination Port Range Length:0x%X ",pstClassifierEntry->ucDestPortRangeLength);
  289. if( MAX_PORT_RANGE >= psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength)
  290. {
  291. for(ucLoopIndex=0;ucLoopIndex<(pstClassifierEntry->ucDestPortRangeLength);ucLoopIndex++)
  292. {
  293. pstClassifierEntry->usDestPortRangeLo[ucLoopIndex] =
  294. *((PUSHORT)(psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange+ucLoopIndex));
  295. pstClassifierEntry->usDestPortRangeHi[ucLoopIndex] =
  296. *((PUSHORT)(psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange+2+ucLoopIndex));
  297. pstClassifierEntry->usDestPortRangeLo[ucLoopIndex]=ntohs(pstClassifierEntry->usDestPortRangeLo[ucLoopIndex]);
  298. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Destination Port Range Lo:0x%X ",pstClassifierEntry->usDestPortRangeLo[ucLoopIndex]);
  299. pstClassifierEntry->usDestPortRangeHi[ucLoopIndex]=ntohs(pstClassifierEntry->usDestPortRangeHi[ucLoopIndex]);
  300. }
  301. }
  302. else
  303. {
  304. pstClassifierEntry->ucDestPortRangeLength=0;
  305. }
  306. //Source Port
  307. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Source Port Range Length:0x%X ",psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength);
  308. if(MAX_PORT_RANGE >=
  309. psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength)
  310. {
  311. pstClassifierEntry->ucSrcPortRangeLength =
  312. psfCSType->cCPacketClassificationRule.
  313. u8ProtocolSourcePortRangeLength/4;
  314. for(ucLoopIndex = 0; ucLoopIndex <
  315. (pstClassifierEntry->ucSrcPortRangeLength); ucLoopIndex++)
  316. {
  317. pstClassifierEntry->usSrcPortRangeLo[ucLoopIndex] =
  318. *((PUSHORT)(psfCSType->cCPacketClassificationRule.
  319. u8ProtocolSourcePortRange+ucLoopIndex));
  320. pstClassifierEntry->usSrcPortRangeHi[ucLoopIndex] =
  321. *((PUSHORT)(psfCSType->cCPacketClassificationRule.
  322. u8ProtocolSourcePortRange+2+ucLoopIndex));
  323. pstClassifierEntry->usSrcPortRangeLo[ucLoopIndex] =
  324. ntohs(pstClassifierEntry->usSrcPortRangeLo[ucLoopIndex]);
  325. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Source Port Range Lo:0x%X ",pstClassifierEntry->usSrcPortRangeLo[ucLoopIndex]);
  326. pstClassifierEntry->usSrcPortRangeHi[ucLoopIndex]=ntohs(pstClassifierEntry->usSrcPortRangeHi[ucLoopIndex]);
  327. }
  328. }
  329. //Destination Ip Address and Mask
  330. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Ip Destination Parameters : ");
  331. CopyIpAddrToClassifier(pstClassifierEntry,
  332. psfCSType->cCPacketClassificationRule.u8IPDestinationAddressLength,
  333. psfCSType->cCPacketClassificationRule.u8IPDestinationAddress,
  334. (Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == IPV6)?
  335. TRUE:FALSE, eDestIpAddress);
  336. //Source Ip Address and Mask
  337. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Ip Source Parameters : ");
  338. CopyIpAddrToClassifier(pstClassifierEntry,
  339. psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddressLength,
  340. psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddress,
  341. (Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == IPV6)?TRUE:FALSE,
  342. eSrcIpAddress);
  343. //TOS
  344. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"TOS Length:0x%X ",psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength);
  345. if(3 == psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength)
  346. {
  347. pstClassifierEntry->ucIPTypeOfServiceLength =
  348. psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength;
  349. pstClassifierEntry->ucTosLow =
  350. psfCSType->cCPacketClassificationRule.u8IPTypeOfService[0];
  351. pstClassifierEntry->ucTosHigh =
  352. psfCSType->cCPacketClassificationRule.u8IPTypeOfService[1];
  353. pstClassifierEntry->ucTosMask =
  354. psfCSType->cCPacketClassificationRule.u8IPTypeOfService[2];
  355. pstClassifierEntry->bTOSValid = TRUE;
  356. }
  357. if(psfCSType->cCPacketClassificationRule.u8Protocol == 0)
  358. {
  359. //we didn't get protocol field filled in by the BS
  360. pstClassifierEntry->ucProtocolLength=0;
  361. }
  362. else
  363. {
  364. pstClassifierEntry->ucProtocolLength=1;// 1 valid protocol
  365. }
  366. pstClassifierEntry->ucProtocol[0] =
  367. psfCSType->cCPacketClassificationRule.u8Protocol;
  368. pstClassifierEntry->u8ClassifierRulePriority =
  369. psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority;
  370. //store the classifier rule ID and set this classifier entry as valid
  371. pstClassifierEntry->ucDirection =
  372. Adapter->PackInfo[uiSearchRuleIndex].ucDirection;
  373. pstClassifierEntry->uiClassifierRuleIndex = ntohs(psfCSType->
  374. cCPacketClassificationRule.u16PacketClassificationRuleIndex);
  375. pstClassifierEntry->usVCID_Value =
  376. Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value;
  377. pstClassifierEntry->ulSFID =
  378. Adapter->PackInfo[uiSearchRuleIndex].ulSFID;
  379. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Search Index %d Dir: %d, Index: %d, Vcid: %d\n",
  380. uiSearchRuleIndex, pstClassifierEntry->ucDirection,
  381. pstClassifierEntry->uiClassifierRuleIndex,
  382. pstClassifierEntry->usVCID_Value);
  383. if(psfCSType->cCPacketClassificationRule.u8AssociatedPHSI)
  384. {
  385. pstClassifierEntry->u8AssociatedPHSI = psfCSType->cCPacketClassificationRule.u8AssociatedPHSI;
  386. }
  387. //Copy ETH CS Parameters
  388. pstClassifierEntry->ucEthCSSrcMACLen = (psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddressLength);
  389. memcpy(pstClassifierEntry->au8EThCSSrcMAC,psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress,MAC_ADDRESS_SIZE);
  390. memcpy(pstClassifierEntry->au8EThCSSrcMACMask,psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress+MAC_ADDRESS_SIZE,MAC_ADDRESS_SIZE);
  391. pstClassifierEntry->ucEthCSDestMACLen = (psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
  392. memcpy(pstClassifierEntry->au8EThCSDestMAC,psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress,MAC_ADDRESS_SIZE);
  393. memcpy(pstClassifierEntry->au8EThCSDestMACMask,psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress+MAC_ADDRESS_SIZE,MAC_ADDRESS_SIZE);
  394. pstClassifierEntry->ucEtherTypeLen = (psfCSType->cCPacketClassificationRule.u8EthertypeLength);
  395. memcpy(pstClassifierEntry->au8EthCSEtherType,psfCSType->cCPacketClassificationRule.u8Ethertype,NUM_ETHERTYPE_BYTES);
  396. memcpy(pstClassifierEntry->usUserPriority, &psfCSType->cCPacketClassificationRule.u16UserPriority, 2);
  397. pstClassifierEntry->usVLANID = ntohs(psfCSType->cCPacketClassificationRule.u16VLANID);
  398. pstClassifierEntry->usValidityBitMap = ntohs(psfCSType->cCPacketClassificationRule.u16ValidityBitMap);
  399. pstClassifierEntry->bUsed = TRUE;
  400. }
  401. }
  402. /**
  403. @ingroup ctrl_pkt_functions
  404. */
  405. static inline VOID DeleteClassifierRuleFromSF(PMINI_ADAPTER Adapter,UINT uiSearchRuleIndex,UINT nClassifierIndex)
  406. {
  407. S_CLASSIFIER_RULE *pstClassifierEntry = NULL;
  408. B_UINT16 u16PacketClassificationRuleIndex;
  409. USHORT usVCID;
  410. //VOID *pvPhsContext = NULL;
  411. //ULONG ulPhsStatus;
  412. usVCID = Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value;
  413. if(nClassifierIndex > MAX_CLASSIFIERS-1)
  414. return;
  415. if(usVCID == 0)
  416. return;
  417. u16PacketClassificationRuleIndex = Adapter->astClassifierTable[nClassifierIndex].uiClassifierRuleIndex;
  418. pstClassifierEntry = &Adapter->astClassifierTable[nClassifierIndex];
  419. if(pstClassifierEntry)
  420. {
  421. pstClassifierEntry->bUsed = FALSE;
  422. pstClassifierEntry->uiClassifierRuleIndex = 0;
  423. memset(pstClassifierEntry,0,sizeof(S_CLASSIFIER_RULE));
  424. //Delete the PHS Rule for this classifier
  425. PhsDeleteClassifierRule(
  426. &Adapter->stBCMPhsContext,
  427. usVCID,
  428. u16PacketClassificationRuleIndex);
  429. }
  430. }
  431. /**
  432. @ingroup ctrl_pkt_functions
  433. */
  434. VOID DeleteAllClassifiersForSF(PMINI_ADAPTER Adapter,UINT uiSearchRuleIndex)
  435. {
  436. S_CLASSIFIER_RULE *pstClassifierEntry = NULL;
  437. UINT nClassifierIndex;
  438. //B_UINT16 u16PacketClassificationRuleIndex;
  439. USHORT ulVCID;
  440. //VOID *pvPhsContext = NULL;
  441. //ULONG ulPhsStatus;
  442. ulVCID = Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value;
  443. if(ulVCID == 0)
  444. return;
  445. for(nClassifierIndex =0 ; nClassifierIndex < MAX_CLASSIFIERS ; nClassifierIndex++)
  446. {
  447. if(Adapter->astClassifierTable[nClassifierIndex].usVCID_Value == ulVCID)
  448. {
  449. pstClassifierEntry = &Adapter->astClassifierTable[nClassifierIndex];
  450. if(pstClassifierEntry->bUsed)
  451. {
  452. DeleteClassifierRuleFromSF(Adapter,uiSearchRuleIndex,nClassifierIndex);
  453. }
  454. }
  455. }
  456. //Delete All Phs Rules Associated with this SF
  457. PhsDeleteSFRules(
  458. &Adapter->stBCMPhsContext,
  459. ulVCID);
  460. }
  461. /**
  462. This routinue copies the Connection Management
  463. related data into the Adapter structure.
  464. @ingroup ctrl_pkt_functions
  465. */
  466. static VOID CopyToAdapter( register PMINI_ADAPTER Adapter, /**<Pointer to the Adapter structure*/
  467. register pstServiceFlowParamSI psfLocalSet, /**<Pointer to the ServiceFlowParamSI structure*/
  468. register UINT uiSearchRuleIndex, /**<Index of Queue, to which this data belongs*/
  469. register UCHAR ucDsxType,
  470. stLocalSFAddIndicationAlt *pstAddIndication)
  471. {
  472. //UCHAR ucProtocolLength=0;
  473. ULONG ulSFID;
  474. UINT nClassifierIndex = 0;
  475. E_CLASSIFIER_ACTION eClassifierAction = eInvalidClassifierAction;
  476. B_UINT16 u16PacketClassificationRuleIndex=0;
  477. UINT nIndex=0;
  478. stConvergenceSLTypes *psfCSType = NULL;
  479. S_PHS_RULE sPhsRule;
  480. USHORT uVCID = Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value;
  481. UINT UGIValue = 0;
  482. Adapter->PackInfo[uiSearchRuleIndex].bValid=TRUE;
  483. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Search Rule Index = %d\n", uiSearchRuleIndex);
  484. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"%s: SFID= %x ",__FUNCTION__, ntohl(psfLocalSet->u32SFID));
  485. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Updating Queue %d",uiSearchRuleIndex);
  486. ulSFID = ntohl(psfLocalSet->u32SFID);
  487. //Store IP Version used
  488. //Get The Version Of IP used (IPv6 or IPv4) from CSSpecification field of SF
  489. Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = 0;
  490. Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = 0;
  491. /*Enable IP/ETh CS Support As Required*/
  492. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"CopyToAdapter : u8CSSpecification : %X\n",psfLocalSet->u8CSSpecification);
  493. switch(psfLocalSet->u8CSSpecification)
  494. {
  495. case eCSPacketIPV4:
  496. {
  497. Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV4_CS;
  498. break;
  499. }
  500. case eCSPacketIPV6:
  501. {
  502. Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV6_CS;
  503. break;
  504. }
  505. case eCS802_3PacketEthernet:
  506. case eCS802_1QPacketVLAN:
  507. {
  508. Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = ETH_CS_802_3;
  509. break;
  510. }
  511. case eCSPacketIPV4Over802_1QVLAN:
  512. case eCSPacketIPV4Over802_3Ethernet:
  513. {
  514. Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV4_CS;
  515. Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = ETH_CS_802_3;
  516. break;
  517. }
  518. case eCSPacketIPV6Over802_1QVLAN:
  519. case eCSPacketIPV6Over802_3Ethernet:
  520. {
  521. Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV6_CS;
  522. Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = ETH_CS_802_3;
  523. break;
  524. }
  525. default:
  526. {
  527. BCM_DEBUG_PRINT (Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Error in value of CS Classification.. setting default to IP CS\n");
  528. Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV4_CS;
  529. break;
  530. }
  531. }
  532. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"CopyToAdapter : Queue No : %X ETH CS Support : %X , IP CS Support : %X \n",
  533. uiSearchRuleIndex,
  534. Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport,
  535. Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport);
  536. //Store IP Version used
  537. //Get The Version Of IP used (IPv6 or IPv4) from CSSpecification field of SF
  538. if(Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport == IPV6_CS)
  539. {
  540. Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion = IPV6;
  541. }
  542. else
  543. {
  544. Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion = IPV4;
  545. }
  546. /* To ensure that the ETH CS code doesn't gets executed if the BS doesn't supports ETH CS */
  547. if(!Adapter->bETHCSEnabled)
  548. Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = 0;
  549. if(psfLocalSet->u8ServiceClassNameLength > 0 &&
  550. psfLocalSet->u8ServiceClassNameLength < 32)
  551. {
  552. memcpy(Adapter->PackInfo[uiSearchRuleIndex].ucServiceClassName,
  553. psfLocalSet->u8ServiceClassName,
  554. psfLocalSet->u8ServiceClassNameLength);
  555. }
  556. Adapter->PackInfo[uiSearchRuleIndex].u8QueueType =
  557. psfLocalSet->u8ServiceFlowSchedulingType;
  558. if(Adapter->PackInfo[uiSearchRuleIndex].u8QueueType==BE &&
  559. Adapter->PackInfo[uiSearchRuleIndex].ucDirection)
  560. {
  561. Adapter->usBestEffortQueueIndex=uiSearchRuleIndex;
  562. }
  563. Adapter->PackInfo[uiSearchRuleIndex].ulSFID = ntohl(psfLocalSet->u32SFID);
  564. Adapter->PackInfo[uiSearchRuleIndex].u8TrafficPriority = psfLocalSet->u8TrafficPriority;
  565. //copy all the classifier in the Service Flow param structure
  566. for(nIndex=0; nIndex<psfLocalSet->u8TotalClassifiers; nIndex++)
  567. {
  568. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Classifier index =%d",nIndex);
  569. psfCSType = &psfLocalSet->cConvergenceSLTypes[nIndex];
  570. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Classifier index =%d",nIndex);
  571. if(psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority)
  572. {
  573. Adapter->PackInfo[uiSearchRuleIndex].bClassifierPriority=TRUE;
  574. }
  575. if(psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority)
  576. {
  577. Adapter->PackInfo[uiSearchRuleIndex].bClassifierPriority=TRUE;
  578. }
  579. if(ucDsxType== DSA_ACK)
  580. {
  581. eClassifierAction = eAddClassifier;
  582. }
  583. else if(ucDsxType == DSC_ACK)
  584. {
  585. switch(psfCSType->u8ClassfierDSCAction)
  586. {
  587. case 0://DSC Add Classifier
  588. {
  589. eClassifierAction = eAddClassifier;
  590. }
  591. break;
  592. case 1://DSC Replace Classifier
  593. {
  594. eClassifierAction = eReplaceClassifier;
  595. }
  596. break;
  597. case 2://DSC Delete Classifier
  598. {
  599. eClassifierAction = eDeleteClassifier;
  600. }
  601. break;
  602. default:
  603. {
  604. eClassifierAction = eInvalidClassifierAction;
  605. }
  606. }
  607. }
  608. u16PacketClassificationRuleIndex = ntohs(psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex);
  609. switch(eClassifierAction)
  610. {
  611. case eAddClassifier:
  612. {
  613. //Get a Free Classifier Index From Classifier table for this SF to add the Classifier
  614. //Contained in this message
  615. nClassifierIndex = SearchClsid(Adapter,ulSFID,u16PacketClassificationRuleIndex);
  616. if(nClassifierIndex > MAX_CLASSIFIERS)
  617. {
  618. nClassifierIndex = SearchFreeClsid(Adapter);
  619. if(nClassifierIndex > MAX_CLASSIFIERS)
  620. {
  621. //Failed To get a free Entry
  622. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Error Failed To get a free Classifier Entry");
  623. break;
  624. }
  625. //Copy the Classifier Rule for this service flow into our Classifier table maintained per SF.
  626. CopyClassifierRuleToSF(Adapter,psfCSType,uiSearchRuleIndex,nClassifierIndex);
  627. }
  628. else
  629. {
  630. //This Classifier Already Exists and it is invalid to Add Classifier with existing PCRI
  631. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"CopyToAdapter : Error The Specified Classifier Already Exists \
  632. and attempted To Add Classifier with Same PCRI : 0x%x\n", u16PacketClassificationRuleIndex);
  633. }
  634. }
  635. break;
  636. case eReplaceClassifier:
  637. {
  638. //Get the Classifier Index From Classifier table for this SF and replace existing Classifier
  639. //with the new classifier Contained in this message
  640. nClassifierIndex = SearchClsid(Adapter,ulSFID,u16PacketClassificationRuleIndex);
  641. if(nClassifierIndex > MAX_CLASSIFIERS)
  642. {
  643. //Failed To search the classifier
  644. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Error Search for Classifier To be replaced failed");
  645. break;
  646. }
  647. //Copy the Classifier Rule for this service flow into our Classifier table maintained per SF.
  648. CopyClassifierRuleToSF(Adapter,psfCSType,uiSearchRuleIndex,nClassifierIndex);
  649. }
  650. break;
  651. case eDeleteClassifier:
  652. {
  653. //Get the Classifier Index From Classifier table for this SF and replace existing Classifier
  654. //with the new classifier Contained in this message
  655. nClassifierIndex = SearchClsid(Adapter,ulSFID,u16PacketClassificationRuleIndex);
  656. if(nClassifierIndex > MAX_CLASSIFIERS)
  657. {
  658. //Failed To search the classifier
  659. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Error Search for Classifier To be deleted failed");
  660. break;
  661. }
  662. //Delete This classifier
  663. DeleteClassifierRuleFromSF(Adapter,uiSearchRuleIndex,nClassifierIndex);
  664. }
  665. break;
  666. default:
  667. {
  668. //Invalid Action for classifier
  669. break;
  670. }
  671. }
  672. }
  673. //Repeat parsing Classification Entries to process PHS Rules
  674. for(nIndex=0; nIndex < psfLocalSet->u8TotalClassifiers; nIndex++)
  675. {
  676. psfCSType = &psfLocalSet->cConvergenceSLTypes[nIndex];
  677. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "psfCSType->u8PhsDSCAction : 0x%x\n",
  678. psfCSType->u8PhsDSCAction );
  679. switch (psfCSType->u8PhsDSCAction)
  680. {
  681. case eDeleteAllPHSRules:
  682. {
  683. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Deleting All PHS Rules For VCID: 0x%X\n",uVCID);
  684. //Delete All the PHS rules for this Service flow
  685. PhsDeleteSFRules(
  686. &Adapter->stBCMPhsContext,
  687. uVCID);
  688. break;
  689. }
  690. case eDeletePHSRule:
  691. {
  692. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"PHS DSC Action = Delete PHS Rule \n");
  693. if(psfCSType->cPhsRule.u8PHSI)
  694. {
  695. PhsDeletePHSRule(
  696. &Adapter->stBCMPhsContext,
  697. uVCID,
  698. psfCSType->cCPacketClassificationRule.u8AssociatedPHSI);
  699. }
  700. else
  701. {
  702. //BCM_DEBUG_PRINT(CONN_MSG,("Error CPHSRule.PHSI is ZERO \n"));
  703. }
  704. break;
  705. }
  706. default :
  707. {
  708. if(ucDsxType == DSC_ACK)
  709. {
  710. //BCM_DEBUG_PRINT(CONN_MSG,("Invalid PHS DSC Action For DSC \n",psfCSType->cPhsRule.u8PHSI));
  711. break; //FOr DSC ACK Case PHS DSC Action must be in valid set
  712. }
  713. }
  714. //Proceed To Add PHS rule for DSA_ACK case even if PHS DSC action is unspecified
  715. //No Break Here . Intentionally!
  716. case eAddPHSRule:
  717. case eSetPHSRule:
  718. {
  719. if(psfCSType->cPhsRule.u8PHSI)
  720. {
  721. //Apply This PHS Rule to all classifiers whose Associated PHSI Match
  722. unsigned int uiClassifierIndex = 0;
  723. if(pstAddIndication->u8Direction == UPLINK_DIR )
  724. {
  725. for(uiClassifierIndex=0;uiClassifierIndex<MAX_CLASSIFIERS;uiClassifierIndex++)
  726. {
  727. if((Adapter->astClassifierTable[uiClassifierIndex].bUsed) &&
  728. (Adapter->astClassifierTable[uiClassifierIndex].ulSFID == Adapter->PackInfo[uiSearchRuleIndex].ulSFID) &&
  729. (Adapter->astClassifierTable[uiClassifierIndex].u8AssociatedPHSI == psfCSType->cPhsRule.u8PHSI))
  730. {
  731. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Adding PHS Rule For Classifier : 0x%x cPhsRule.u8PHSI : 0x%x\n",
  732. Adapter->astClassifierTable[uiClassifierIndex].uiClassifierRuleIndex,
  733. psfCSType->cPhsRule.u8PHSI);
  734. //Update The PHS Rule for this classifier as Associated PHSI id defined
  735. //Copy the PHS Rule
  736. sPhsRule.u8PHSI = psfCSType->cPhsRule.u8PHSI;
  737. sPhsRule.u8PHSFLength = psfCSType->cPhsRule.u8PHSFLength;
  738. sPhsRule.u8PHSMLength = psfCSType->cPhsRule.u8PHSMLength;
  739. sPhsRule.u8PHSS = psfCSType->cPhsRule.u8PHSS;
  740. sPhsRule.u8PHSV = psfCSType->cPhsRule.u8PHSV;
  741. memcpy(sPhsRule.u8PHSF,psfCSType->cPhsRule.u8PHSF,MAX_PHS_LENGTHS);
  742. memcpy(sPhsRule.u8PHSM,psfCSType->cPhsRule.u8PHSM,MAX_PHS_LENGTHS);
  743. sPhsRule.u8RefCnt = 0;
  744. sPhsRule.bUnclassifiedPHSRule = FALSE;
  745. sPhsRule.PHSModifiedBytes = 0;
  746. sPhsRule.PHSModifiedNumPackets = 0;
  747. sPhsRule.PHSErrorNumPackets = 0;
  748. //bPHSRuleAssociated = TRUE;
  749. //Store The PHS Rule for this classifier
  750. PhsUpdateClassifierRule(
  751. &Adapter->stBCMPhsContext,
  752. uVCID,
  753. Adapter->astClassifierTable[uiClassifierIndex].uiClassifierRuleIndex,
  754. &sPhsRule,
  755. Adapter->astClassifierTable[uiClassifierIndex].u8AssociatedPHSI);
  756. //Update PHS Rule For the Classifier
  757. if(sPhsRule.u8PHSI)
  758. {
  759. Adapter->astClassifierTable[uiClassifierIndex].u32PHSRuleID = sPhsRule.u8PHSI;
  760. memcpy(&Adapter->astClassifierTable[uiClassifierIndex].sPhsRule,&sPhsRule,sizeof(S_PHS_RULE));
  761. }
  762. }
  763. }
  764. }
  765. else
  766. {
  767. //Error PHS Rule specified in signaling could not be applied to any classifier
  768. //Copy the PHS Rule
  769. sPhsRule.u8PHSI = psfCSType->cPhsRule.u8PHSI;
  770. sPhsRule.u8PHSFLength = psfCSType->cPhsRule.u8PHSFLength;
  771. sPhsRule.u8PHSMLength = psfCSType->cPhsRule.u8PHSMLength;
  772. sPhsRule.u8PHSS = psfCSType->cPhsRule.u8PHSS;
  773. sPhsRule.u8PHSV = psfCSType->cPhsRule.u8PHSV;
  774. memcpy(sPhsRule.u8PHSF,psfCSType->cPhsRule.u8PHSF,MAX_PHS_LENGTHS);
  775. memcpy(sPhsRule.u8PHSM,psfCSType->cPhsRule.u8PHSM,MAX_PHS_LENGTHS);
  776. sPhsRule.u8RefCnt = 0;
  777. sPhsRule.bUnclassifiedPHSRule = TRUE;
  778. sPhsRule.PHSModifiedBytes = 0;
  779. sPhsRule.PHSModifiedNumPackets = 0;
  780. sPhsRule.PHSErrorNumPackets = 0;
  781. //Store The PHS Rule for this classifier
  782. /*
  783. Passing the argument u8PHSI instead of clsid. Because for DL with no classifier rule,
  784. clsid will be zero hence we can't have multiple PHS rules for the same SF.
  785. To support multiple PHS rule, passing u8PHSI.
  786. */
  787. PhsUpdateClassifierRule(
  788. &Adapter->stBCMPhsContext,
  789. uVCID,
  790. sPhsRule.u8PHSI,
  791. &sPhsRule,
  792. sPhsRule.u8PHSI);
  793. }
  794. }
  795. }
  796. break;
  797. }
  798. }
  799. if(psfLocalSet->u32MaxSustainedTrafficRate == 0 )
  800. {
  801. //No Rate Limit . Set Max Sustained Traffic Rate to Maximum
  802. Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate =
  803. WIMAX_MAX_ALLOWED_RATE;
  804. }
  805. else if (ntohl(psfLocalSet->u32MaxSustainedTrafficRate) >
  806. WIMAX_MAX_ALLOWED_RATE)
  807. {
  808. //Too large Allowed Rate specified. Limiting to Wi Max Allowed rate
  809. Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate =
  810. WIMAX_MAX_ALLOWED_RATE;
  811. }
  812. else
  813. {
  814. Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate =
  815. ntohl(psfLocalSet->u32MaxSustainedTrafficRate);
  816. }
  817. Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency = ntohl(psfLocalSet->u32MaximumLatency);
  818. if(Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency == 0) /* 0 should be treated as infinite */
  819. Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency = MAX_LATENCY_ALLOWED;
  820. if(( Adapter->PackInfo[uiSearchRuleIndex].u8QueueType == ERTPS ||
  821. Adapter->PackInfo[uiSearchRuleIndex].u8QueueType == UGS ) )
  822. UGIValue = ntohs(psfLocalSet->u16UnsolicitedGrantInterval);
  823. if(UGIValue == 0)
  824. UGIValue = DEFAULT_UG_INTERVAL;
  825. /*
  826. For UGI based connections...
  827. DEFAULT_UGI_FACTOR*UGIInterval worth of data is the max token count at host...
  828. The extra amount of token is to ensure that a large amount of jitter won't have loss in throughput...
  829. In case of non-UGI based connection, 200 frames worth of data is the max token count at host...
  830. */
  831. Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize =
  832. (DEFAULT_UGI_FACTOR*Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate*UGIValue)/1000;
  833. if(Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize < WIMAX_MAX_MTU*8)
  834. {
  835. UINT UGIFactor = 0;
  836. /* Special Handling to ensure the biggest size of packet can go out from host to FW as follows:
  837. 1. Any packet from Host to FW can go out in different packet size.
  838. 2. So in case the Bucket count is smaller than MTU, the packets of size (Size > TokenCount), will get dropped.
  839. 3. We can allow packets of MaxSize from Host->FW that can go out from FW in multiple SDUs by fragmentation at Wimax Layer
  840. */
  841. UGIFactor = (Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency/UGIValue + 1);
  842. if(UGIFactor > DEFAULT_UGI_FACTOR)
  843. Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize =
  844. (UGIFactor*Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate*UGIValue)/1000;
  845. if(Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize > WIMAX_MAX_MTU*8)
  846. Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize = WIMAX_MAX_MTU*8;
  847. }
  848. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"LAT: %d, UGI: %d \n", Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency, UGIValue);
  849. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"uiMaxAllowedRate: 0x%x, u32MaxSustainedTrafficRate: 0x%x ,uiMaxBucketSize: 0x%x",
  850. Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate,
  851. ntohl(psfLocalSet->u32MaxSustainedTrafficRate),
  852. Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize);
  853. //copy the extended SF Parameters to Support MIBS
  854. CopyMIBSExtendedSFParameters(Adapter,psfLocalSet,uiSearchRuleIndex);
  855. //store header suppression enabled flag per SF
  856. Adapter->PackInfo[uiSearchRuleIndex].bHeaderSuppressionEnabled =
  857. !(psfLocalSet->u8RequesttransmissionPolicy &
  858. MASK_DISABLE_HEADER_SUPPRESSION);
  859. kfree(Adapter->PackInfo[uiSearchRuleIndex].pstSFIndication);
  860. Adapter->PackInfo[uiSearchRuleIndex].pstSFIndication = pstAddIndication;
  861. //Re Sort the SF list in PackInfo according to Traffic Priority
  862. SortPackInfo(Adapter);
  863. /* Re Sort the Classifier Rules table and re - arrange
  864. according to Classifier Rule Priority */
  865. SortClassifiers(Adapter);
  866. DumpPhsRules(&Adapter->stBCMPhsContext);
  867. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"%s <=====", __FUNCTION__);
  868. }
  869. /***********************************************************************
  870. * Function - DumpCmControlPacket
  871. *
  872. * Description - This routinue Dumps the Contents of the AddIndication
  873. * Structure in the Connection Management Control Packet
  874. *
  875. * Parameter - pvBuffer: Pointer to the buffer containing the
  876. * AddIndication data.
  877. *
  878. * Returns - None
  879. *************************************************************************/
  880. static VOID DumpCmControlPacket(PVOID pvBuffer)
  881. {
  882. UINT uiLoopIndex;
  883. UINT nIndex;
  884. stLocalSFAddIndicationAlt *pstAddIndication;
  885. UINT nCurClassifierCnt;
  886. PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev);
  887. pstAddIndication = (stLocalSFAddIndicationAlt *)pvBuffer;
  888. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "======>");
  889. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Type : 0x%X",pstAddIndication->u8Type);
  890. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Direction : 0x%X",pstAddIndication->u8Direction);
  891. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TID: 0x%X", ntohs(pstAddIndication->u16TID));
  892. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16CID : 0x%X",ntohs(pstAddIndication->u16CID));
  893. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16VCID : 0x%X",ntohs(pstAddIndication->u16VCID));
  894. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " AuthorizedSet--->");
  895. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32SFID : 0x%X",htonl(pstAddIndication->sfAuthorizedSet.u32SFID));
  896. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16CID : 0x%X",htons(pstAddIndication->sfAuthorizedSet.u16CID));
  897. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassNameLength : 0x%X",
  898. pstAddIndication->sfAuthorizedSet.u8ServiceClassNameLength);
  899. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassName : 0x%X ,0x%X , 0x%X, 0x%X, 0x%X, 0x%X",
  900. pstAddIndication->sfAuthorizedSet.u8ServiceClassName[0],
  901. pstAddIndication->sfAuthorizedSet.u8ServiceClassName[1],
  902. pstAddIndication->sfAuthorizedSet.u8ServiceClassName[2],
  903. pstAddIndication->sfAuthorizedSet.u8ServiceClassName[3],
  904. pstAddIndication->sfAuthorizedSet.u8ServiceClassName[4],
  905. pstAddIndication->sfAuthorizedSet.u8ServiceClassName[5]);
  906. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8MBSService : 0x%X",
  907. pstAddIndication->sfAuthorizedSet.u8MBSService);
  908. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8QosParamSet : 0x%X",
  909. pstAddIndication->sfAuthorizedSet.u8QosParamSet);
  910. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficPriority : 0x%X, %p",
  911. pstAddIndication->sfAuthorizedSet.u8TrafficPriority, &pstAddIndication->sfAuthorizedSet.u8TrafficPriority);
  912. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaxSustainedTrafficRate : 0x%X 0x%p",
  913. pstAddIndication->sfAuthorizedSet.u32MaxSustainedTrafficRate,
  914. &pstAddIndication->sfAuthorizedSet.u32MaxSustainedTrafficRate);
  915. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaxTrafficBurst : 0x%X",
  916. pstAddIndication->sfAuthorizedSet.u32MaxTrafficBurst);
  917. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MinReservedTrafficRate : 0x%X",
  918. pstAddIndication->sfAuthorizedSet.u32MinReservedTrafficRate);
  919. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParamLength : 0x%X",
  920. pstAddIndication->sfAuthorizedSet.u8VendorSpecificQoSParamLength);
  921. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParam : 0x%X",
  922. pstAddIndication->sfAuthorizedSet.u8VendorSpecificQoSParam[0]);
  923. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceFlowSchedulingType : 0x%X",
  924. pstAddIndication->sfAuthorizedSet.u8ServiceFlowSchedulingType);
  925. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32ToleratedJitter : 0x%X",
  926. pstAddIndication->sfAuthorizedSet.u32ToleratedJitter);
  927. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaximumLatency : 0x%X",
  928. pstAddIndication->sfAuthorizedSet.u32MaximumLatency);
  929. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8FixedLengthVSVariableLengthSDUIndicator: 0x%X",
  930. pstAddIndication->sfAuthorizedSet.u8FixedLengthVSVariableLengthSDUIndicator);
  931. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8SDUSize : 0x%X",
  932. pstAddIndication->sfAuthorizedSet.u8SDUSize);
  933. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TargetSAID : 0x%X",
  934. pstAddIndication->sfAuthorizedSet.u16TargetSAID);
  935. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ARQEnable : 0x%X",
  936. pstAddIndication->sfAuthorizedSet.u8ARQEnable);
  937. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQWindowSize : 0x%X",
  938. pstAddIndication->sfAuthorizedSet.u16ARQWindowSize);
  939. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRetryTxTimeOut : 0x%X",
  940. pstAddIndication->sfAuthorizedSet.u16ARQRetryTxTimeOut);
  941. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRetryRxTimeOut : 0x%X",
  942. pstAddIndication->sfAuthorizedSet.u16ARQRetryRxTimeOut);
  943. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQBlockLifeTime : 0x%X",
  944. pstAddIndication->sfAuthorizedSet.u16ARQBlockLifeTime);
  945. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQSyncLossTimeOut : 0x%X",
  946. pstAddIndication->sfAuthorizedSet.u16ARQSyncLossTimeOut);
  947. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ARQDeliverInOrder : 0x%X",
  948. pstAddIndication->sfAuthorizedSet.u8ARQDeliverInOrder);
  949. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRxPurgeTimeOut : 0x%X",
  950. pstAddIndication->sfAuthorizedSet.u16ARQRxPurgeTimeOut);
  951. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQBlockSize : 0x%X",
  952. pstAddIndication->sfAuthorizedSet.u16ARQBlockSize);
  953. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8CSSpecification : 0x%X",
  954. pstAddIndication->sfAuthorizedSet.u8CSSpecification);
  955. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TypeOfDataDeliveryService : 0x%X",
  956. pstAddIndication->sfAuthorizedSet.u8TypeOfDataDeliveryService);
  957. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16SDUInterArrivalTime : 0x%X",
  958. pstAddIndication->sfAuthorizedSet.u16SDUInterArrivalTime);
  959. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TimeBase : 0x%X",
  960. pstAddIndication->sfAuthorizedSet.u16TimeBase);
  961. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8PagingPreference : 0x%X",
  962. pstAddIndication->sfAuthorizedSet.u8PagingPreference);
  963. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16UnsolicitedPollingInterval : 0x%X",
  964. pstAddIndication->sfAuthorizedSet.u16UnsolicitedPollingInterval);
  965. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "sfAuthorizedSet.u8HARQChannelMapping %x %x %x ",
  966. *(unsigned int*)pstAddIndication->sfAuthorizedSet.u8HARQChannelMapping,
  967. *(unsigned int*)&pstAddIndication->sfAuthorizedSet.u8HARQChannelMapping[4],
  968. *(USHORT*) &pstAddIndication->sfAuthorizedSet.u8HARQChannelMapping[8]);
  969. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficIndicationPreference : 0x%X",
  970. pstAddIndication->sfAuthorizedSet.u8TrafficIndicationPreference);
  971. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " Total Classifiers Received : 0x%X",pstAddIndication->sfAuthorizedSet.u8TotalClassifiers);
  972. nCurClassifierCnt = pstAddIndication->sfAuthorizedSet.u8TotalClassifiers;
  973. if(nCurClassifierCnt > MAX_CLASSIFIERS_IN_SF)
  974. {
  975. nCurClassifierCnt = MAX_CLASSIFIERS_IN_SF;
  976. }
  977. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "pstAddIndication->sfAuthorizedSet.bValid %d", pstAddIndication->sfAuthorizedSet.bValid);
  978. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "pstAddIndication->sfAuthorizedSet.u16MacOverhead %x", pstAddIndication->sfAuthorizedSet.u16MacOverhead);
  979. if(!pstAddIndication->sfAuthorizedSet.bValid)
  980. pstAddIndication->sfAuthorizedSet.bValid=1;
  981. for(nIndex = 0 ; nIndex < nCurClassifierCnt ; nIndex++)
  982. {
  983. stConvergenceSLTypes *psfCSType = NULL;
  984. psfCSType = &pstAddIndication->sfAuthorizedSet.cConvergenceSLTypes[nIndex];
  985. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "psfCSType = %p", psfCSType);
  986. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "CCPacketClassificationRuleSI====>");
  987. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ClassifierRulePriority :0x%X ",
  988. psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority);
  989. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPTypeOfServiceLength :0x%X ",
  990. psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength);
  991. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPTypeOfService[3] :0x%X ,0x%X ,0x%X ",
  992. psfCSType->cCPacketClassificationRule.u8IPTypeOfService[0],
  993. psfCSType->cCPacketClassificationRule.u8IPTypeOfService[1],
  994. psfCSType->cCPacketClassificationRule.u8IPTypeOfService[2]);
  995. for(uiLoopIndex=0; uiLoopIndex < 1; uiLoopIndex++)
  996. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Protocol : 0x%02X ",
  997. psfCSType->cCPacketClassificationRule.u8Protocol);
  998. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddressLength :0x%X ",
  999. psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddressLength);
  1000. for(uiLoopIndex=0; uiLoopIndex < 32; uiLoopIndex++)
  1001. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddress[32] : 0x%02X ",
  1002. psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddress[uiLoopIndex]);
  1003. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddressLength : 0x%X ",
  1004. psfCSType->cCPacketClassificationRule.u8IPDestinationAddressLength);
  1005. for(uiLoopIndex=0; uiLoopIndex < 32; uiLoopIndex++)
  1006. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddress[32] : 0x%02X ",
  1007. psfCSType->cCPacketClassificationRule.u8IPDestinationAddress[uiLoopIndex]);
  1008. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolSourcePortRangeLength:0x%X ",
  1009. psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength);
  1010. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolSourcePortRange[4]: 0x%02X ,0x%02X ,0x%02X ,0x%02X ",
  1011. psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[0],
  1012. psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[1],
  1013. psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[2],
  1014. psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[3]);
  1015. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolDestPortRangeLength : 0x%02X ",
  1016. psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength);
  1017. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolDestPortRange[4]: 0x%02X ,0x%02X ,0x%02X ,0x%02X ",
  1018. psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[0],
  1019. psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[1],
  1020. psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[2],
  1021. psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[3]);
  1022. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetDestMacAddressLength : 0x%02X ",
  1023. psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
  1024. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetDestMacAddress[6] : 0x %02X %02X %02X %02X %02X %02X",
  1025. psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[0],
  1026. psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[1],
  1027. psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[2],
  1028. psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[3],
  1029. psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[4],
  1030. psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[5]);
  1031. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetSourceMACAddressLength : 0x%02X ",
  1032. psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
  1033. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetSourceMACAddress[6] : 0x %02X %02X %02X %02X %02X %02X",
  1034. psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[0],
  1035. psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[1],
  1036. psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[2],
  1037. psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[3],
  1038. psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[4],
  1039. psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[5]);
  1040. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthertypeLength : 0x%02X ",
  1041. psfCSType->cCPacketClassificationRule.u8EthertypeLength);
  1042. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Ethertype[3] : 0x%02X ,0x%02X ,0x%02X ",
  1043. psfCSType->cCPacketClassificationRule.u8Ethertype[0],
  1044. psfCSType->cCPacketClassificationRule.u8Ethertype[1],
  1045. psfCSType->cCPacketClassificationRule.u8Ethertype[2]);
  1046. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16UserPriority : 0x%X ",
  1047. psfCSType->cCPacketClassificationRule.u16UserPriority);
  1048. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16VLANID : 0x%X ",
  1049. psfCSType->cCPacketClassificationRule.u16VLANID);
  1050. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8AssociatedPHSI : 0x%02X ",
  1051. psfCSType->cCPacketClassificationRule.u8AssociatedPHSI);
  1052. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16PacketClassificationRuleIndex : 0x%X ",
  1053. psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex);
  1054. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificClassifierParamLength : 0x%X ",
  1055. psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParamLength);
  1056. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificClassifierParam[1] : 0x%X ",
  1057. psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParam[0]);
  1058. #ifdef VERSION_D5
  1059. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPv6FlowLableLength :0x%X ",
  1060. psfCSType->cCPacketClassificationRule.u8IPv6FlowLableLength);
  1061. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPv6FlowLable[6] : 0x %02X %02X %02X %02X %02X %02X ",
  1062. psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[0],
  1063. psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[1],
  1064. psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[2],
  1065. psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[3],
  1066. psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[4],
  1067. psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[5]);
  1068. #endif
  1069. }
  1070. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "bValid : 0x%02X",pstAddIndication->sfAuthorizedSet.bValid);
  1071. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "AdmittedSet--->");
  1072. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32SFID : 0x%X",pstAddIndication->sfAdmittedSet.u32SFID);
  1073. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16CID : 0x%X",pstAddIndication->sfAdmittedSet.u16CID);
  1074. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassNameLength : 0x%X",
  1075. pstAddIndication->sfAdmittedSet.u8ServiceClassNameLength);
  1076. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassName : 0x %02X %02X %02X %02X %02X %02X",
  1077. pstAddIndication->sfAdmittedSet.u8ServiceClassName[0],
  1078. pstAddIndication->sfAdmittedSet.u8ServiceClassName[1],
  1079. pstAddIndication->sfAdmittedSet.u8ServiceClassName[2],
  1080. pstAddIndication->sfAdmittedSet.u8ServiceClassName[3],
  1081. pstAddIndication->sfAdmittedSet.u8ServiceClassName[4],
  1082. pstAddIndication->sfAdmittedSet.u8ServiceClassName[5]);
  1083. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8MBSService : 0x%02X",
  1084. pstAddIndication->sfAdmittedSet.u8MBSService);
  1085. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8QosParamSet : 0x%02X",
  1086. pstAddIndication->sfAdmittedSet.u8QosParamSet);
  1087. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficPriority : 0x%02X",
  1088. pstAddIndication->sfAdmittedSet.u8TrafficPriority);
  1089. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaxTrafficBurst : 0x%X",
  1090. pstAddIndication->sfAdmittedSet.u32MaxTrafficBurst);
  1091. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MinReservedTrafficRate : 0x%X",
  1092. pstAddIndication->sfAdmittedSet.u32MinReservedTrafficRate);
  1093. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParamLength : 0x%02X",
  1094. pstAddIndication->sfAdmittedSet.u8VendorSpecificQoSParamLength);
  1095. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParam : 0x%02X",
  1096. pstAddIndication->sfAdmittedSet.u8VendorSpecificQoSParam[0]);
  1097. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceFlowSchedulingType : 0x%02X",
  1098. pstAddIndication->sfAdmittedSet.u8ServiceFlowSchedulingType);
  1099. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32ToleratedJitter : 0x%X",
  1100. pstAddIndication->sfAdmittedSet.u32ToleratedJitter);
  1101. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaximumLatency : 0x%X",
  1102. pstAddIndication->sfAdmittedSet.u32MaximumLatency);
  1103. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8FixedLengthVSVariableLengthSDUIndicator: 0x%02X",
  1104. pstAddIndication->sfAdmittedSet.u8FixedLengthVSVariableLengthSDUIndicator);
  1105. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8SDUSize : 0x%02X",
  1106. pstAddIndication->sfAdmittedSet.u8SDUSize);
  1107. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TargetSAID : 0x%02X",
  1108. pstAddIndication->sfAdmittedSet.u16TargetSAID);
  1109. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ARQEnable : 0x%02X",
  1110. pstAddIndication->sfAdmittedSet.u8ARQEnable);
  1111. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQWindowSize : 0x%X",
  1112. pstAddIndication->sfAdmittedSet.u16ARQWindowSize);
  1113. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRetryTxTimeOut : 0x%X",
  1114. pstAddIndication->sfAdmittedSet.u16ARQRetryTxTimeOut);
  1115. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRetryRxTimeOut : 0x%X",
  1116. pstAddIndication->sfAdmittedSet.u16ARQRetryRxTimeOut);
  1117. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQBlockLifeTime : 0x%X",
  1118. pstAddIndication->sfAdmittedSet.u16ARQBlockLifeTime);
  1119. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQSyncLossTimeOut : 0x%X",
  1120. pstAddIndication->sfAdmittedSet.u16ARQSyncLossTimeOut);
  1121. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ARQDeliverInOrder : 0x%02X",
  1122. pstAddIndication->sfAdmittedSet.u8ARQDeliverInOrder);
  1123. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQRxPurgeTimeOut : 0x%X",
  1124. pstAddIndication->sfAdmittedSet.u16ARQRxPurgeTimeOut);
  1125. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16ARQBlockSize : 0x%X",
  1126. pstAddIndication->sfAdmittedSet.u16ARQBlockSize);
  1127. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8CSSpecification : 0x%02X",
  1128. pstAddIndication->sfAdmittedSet.u8CSSpecification);
  1129. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TypeOfDataDeliveryService : 0x%02X",
  1130. pstAddIndication->sfAdmittedSet.u8TypeOfDataDeliveryService);
  1131. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16SDUInterArrivalTime : 0x%X",
  1132. pstAddIndication->sfAdmittedSet.u16SDUInterArrivalTime);
  1133. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16TimeBase : 0x%X",
  1134. pstAddIndication->sfAdmittedSet.u16TimeBase);
  1135. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8PagingPreference : 0x%X",
  1136. pstAddIndication->sfAdmittedSet.u8PagingPreference);
  1137. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficIndicationPreference : 0x%02X",
  1138. pstAddIndication->sfAdmittedSet.u8TrafficIndicationPreference);
  1139. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " Total Classifiers Received : 0x%X",pstAddIndication->sfAdmittedSet.u8TotalClassifiers);
  1140. nCurClassifierCnt = pstAddIndication->sfAdmittedSet.u8TotalClassifiers;
  1141. if(nCurClassifierCnt > MAX_CLASSIFIERS_IN_SF)
  1142. {
  1143. nCurClassifierCnt = MAX_CLASSIFIERS_IN_SF;
  1144. }
  1145. for(nIndex = 0 ; nIndex < nCurClassifierCnt ; nIndex++)
  1146. {
  1147. stConvergenceSLTypes *psfCSType = NULL;
  1148. psfCSType = &pstAddIndication->sfAdmittedSet.cConvergenceSLTypes[nIndex];
  1149. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " CCPacketClassificationRuleSI====>");
  1150. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ClassifierRulePriority :0x%02X ",
  1151. psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority);
  1152. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPTypeOfServiceLength :0x%02X",
  1153. psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength);
  1154. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPTypeOfService[3] :0x%02X %02X %02X",
  1155. psfCSType->cCPacketClassificationRule.u8IPTypeOfService[0],
  1156. psfCSType->cCPacketClassificationRule.u8IPTypeOfService[1],
  1157. psfCSType->cCPacketClassificationRule.u8IPTypeOfService[2]);
  1158. for(uiLoopIndex=0; uiLoopIndex < 1; uiLoopIndex++)
  1159. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Protocol: 0x%02X ",
  1160. psfCSType->cCPacketClassificationRule.u8Protocol);
  1161. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddressLength :0x%02X ",
  1162. psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddressLength);
  1163. for(uiLoopIndex=0; uiLoopIndex < 32; uiLoopIndex++)
  1164. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddress[32] : 0x%02X ",
  1165. psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddress[uiLoopIndex]);
  1166. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddressLength : 0x%02X ",
  1167. psfCSType->cCPacketClassificationRule.u8IPDestinationAddressLength);
  1168. for(uiLoopIndex=0; uiLoopIndex < 32; uiLoopIndex++)
  1169. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddress[32] : 0x%02X ",
  1170. psfCSType->cCPacketClassificationRule.u8IPDestinationAddress[uiLoopIndex]);
  1171. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolSourcePortRangeLength : 0x%02X ",
  1172. psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength);
  1173. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolSourcePortRange[4] : 0x %02X %02X %02X %02X ",
  1174. psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[0],
  1175. psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[1],
  1176. psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[2],
  1177. psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[3]);
  1178. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolDestPortRangeLength : 0x%02X ",
  1179. psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength);
  1180. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ProtocolDestPortRange[4] : 0x %02X %02X %02X %02X ",
  1181. psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[0],
  1182. psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[1],
  1183. psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[2],
  1184. psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[3]);
  1185. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetDestMacAddressLength : 0x%02X ",
  1186. psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
  1187. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetDestMacAddress[6] : 0x %02X %02X %02X %02X %02X %02X",
  1188. psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[0],
  1189. psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[1],
  1190. psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[2],
  1191. psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[3],
  1192. psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[4],
  1193. psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[5]);
  1194. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetSourceMACAddressLength : 0x%02X ",
  1195. psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
  1196. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetSourceMACAddress[6] : 0x %02X %02X %02X %02X %02X %02X",
  1197. psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[0],
  1198. psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[1],
  1199. psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[2],
  1200. psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[3],
  1201. psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[4],
  1202. psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[5]);
  1203. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthertypeLength : 0x%02X ",
  1204. psfCSType->cCPacketClassificationRule.u8EthertypeLength);
  1205. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8Ethertype[3] : 0x%02X %02X %02X",
  1206. psfCSType->cCPacketClassificationRule.u8Ethertype[0],
  1207. psfCSType->cCPacketClassificationRule.u8Ethertype[1],
  1208. psfCSType->cCPacketClassificationRule.u8Ethertype[2]);
  1209. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16UserPriority : 0x%X ",
  1210. psfCSType->cCPacketClassificationRule.u16UserPriority);
  1211. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16VLANID : 0x%X ",
  1212. psfCSType->cCPacketClassificationRule.u16VLANID);
  1213. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8AssociatedPHSI : 0x%02X ",
  1214. psfCSType->cCPacketClassificationRule.u8AssociatedPHSI);
  1215. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16PacketClassificationRuleIndex : 0x%X ",
  1216. psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex);
  1217. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificClassifierParamLength : 0x%02X",
  1218. psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParamLength);
  1219. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificClassifierParam[1] : 0x%02X ",
  1220. psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParam[0]);
  1221. #ifdef VERSION_D5
  1222. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPv6FlowLableLength : 0x%X ",
  1223. psfCSType->cCPacketClassificationRule.u8IPv6FlowLableLength);
  1224. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPv6FlowLable[6] : 0x %02X %02X %02X %02X %02X %02X ",
  1225. psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[0],
  1226. psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[1],
  1227. psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[2],
  1228. psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[3],
  1229. psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[4],
  1230. psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[5]);
  1231. #endif
  1232. }
  1233. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "bValid : 0x%X",pstAddIndication->sfAdmittedSet.bValid);
  1234. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " ActiveSet--->");
  1235. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32SFID : 0x%X",pstAddIndication->sfActiveSet.u32SFID);
  1236. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u16CID : 0x%X",pstAddIndication->sfActiveSet.u16CID);
  1237. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassNameLength : 0x%X",
  1238. pstAddIndication->sfActiveSet.u8ServiceClassNameLength);
  1239. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceClassName : 0x %02X %02X %02X %02X %02X %02X",
  1240. pstAddIndication->sfActiveSet.u8ServiceClassName[0],
  1241. pstAddIndication->sfActiveSet.u8ServiceClassName[1],
  1242. pstAddIndication->sfActiveSet.u8ServiceClassName[2],
  1243. pstAddIndication->sfActiveSet.u8ServiceClassName[3],
  1244. pstAddIndication->sfActiveSet.u8ServiceClassName[4],
  1245. pstAddIndication->sfActiveSet.u8ServiceClassName[5]);
  1246. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8MBSService : 0x%02X",
  1247. pstAddIndication->sfActiveSet.u8MBSService);
  1248. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8QosParamSet : 0x%02X",
  1249. pstAddIndication->sfActiveSet.u8QosParamSet);
  1250. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8TrafficPriority : 0x%02X",
  1251. pstAddIndication->sfActiveSet.u8TrafficPriority);
  1252. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaxTrafficBurst : 0x%X",
  1253. pstAddIndication->sfActiveSet.u32MaxTrafficBurst);
  1254. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MinReservedTrafficRate : 0x%X",
  1255. pstAddIndication->sfActiveSet.u32MinReservedTrafficRate);
  1256. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParamLength : 0x%02X",
  1257. pstAddIndication->sfActiveSet.u8VendorSpecificQoSParamLength);
  1258. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8VendorSpecificQoSParam : 0x%02X",
  1259. pstAddIndication->sfActiveSet.u8VendorSpecificQoSParam[0]);
  1260. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8ServiceFlowSchedulingType : 0x%02X",
  1261. pstAddIndication->sfActiveSet.u8ServiceFlowSchedulingType);
  1262. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32ToleratedJitter : 0x%X",
  1263. pstAddIndication->sfActiveSet.u32ToleratedJitter);
  1264. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u32MaximumLatency : 0x%X",
  1265. pstAddIndication->sfActiveSet.u32MaximumLatency);
  1266. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8FixedLengthVSVariableLengthSDUIndicator: 0x%02X",
  1267. pstAddIndication->sfActiveSet.u8FixedLengthVSVariableLengthSDUIndicator);
  1268. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8SDUSize : 0x%X",
  1269. pstAddIndication->sfActiveSet.u8SDUSize);
  1270. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16TargetSAID : 0x%X",
  1271. pstAddIndication->sfActiveSet.u16TargetSAID);
  1272. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ARQEnable : 0x%X",
  1273. pstAddIndication->sfActiveSet.u8ARQEnable);
  1274. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQWindowSize : 0x%X",
  1275. pstAddIndication->sfActiveSet.u16ARQWindowSize);
  1276. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQRetryTxTimeOut : 0x%X",
  1277. pstAddIndication->sfActiveSet.u16ARQRetryTxTimeOut);
  1278. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQRetryRxTimeOut : 0x%X",
  1279. pstAddIndication->sfActiveSet.u16ARQRetryRxTimeOut);
  1280. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQBlockLifeTime : 0x%X",
  1281. pstAddIndication->sfActiveSet.u16ARQBlockLifeTime);
  1282. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQSyncLossTimeOut : 0x%X",
  1283. pstAddIndication->sfActiveSet.u16ARQSyncLossTimeOut);
  1284. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ARQDeliverInOrder : 0x%X",
  1285. pstAddIndication->sfActiveSet.u8ARQDeliverInOrder);
  1286. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQRxPurgeTimeOut : 0x%X",
  1287. pstAddIndication->sfActiveSet.u16ARQRxPurgeTimeOut);
  1288. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16ARQBlockSize : 0x%X",
  1289. pstAddIndication->sfActiveSet.u16ARQBlockSize);
  1290. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8CSSpecification : 0x%X",
  1291. pstAddIndication->sfActiveSet.u8CSSpecification);
  1292. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8TypeOfDataDeliveryService : 0x%X",
  1293. pstAddIndication->sfActiveSet.u8TypeOfDataDeliveryService);
  1294. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16SDUInterArrivalTime : 0x%X",
  1295. pstAddIndication->sfActiveSet.u16SDUInterArrivalTime);
  1296. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16TimeBase : 0x%X",
  1297. pstAddIndication->sfActiveSet.u16TimeBase);
  1298. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8PagingPreference : 0x%X",
  1299. pstAddIndication->sfActiveSet.u8PagingPreference);
  1300. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8TrafficIndicationPreference : 0x%X",
  1301. pstAddIndication->sfActiveSet.u8TrafficIndicationPreference);
  1302. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " Total Classifiers Received : 0x%X",pstAddIndication->sfActiveSet.u8TotalClassifiers);
  1303. nCurClassifierCnt = pstAddIndication->sfActiveSet.u8TotalClassifiers;
  1304. if(nCurClassifierCnt > MAX_CLASSIFIERS_IN_SF)
  1305. {
  1306. nCurClassifierCnt = MAX_CLASSIFIERS_IN_SF;
  1307. }
  1308. for(nIndex = 0 ; nIndex < nCurClassifierCnt ; nIndex++)
  1309. {
  1310. stConvergenceSLTypes *psfCSType = NULL;
  1311. psfCSType = &pstAddIndication->sfActiveSet.cConvergenceSLTypes[nIndex];
  1312. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " CCPacketClassificationRuleSI====>");
  1313. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ClassifierRulePriority :0x%X ",
  1314. psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority);
  1315. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8IPTypeOfServiceLength :0x%X ",
  1316. psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength);
  1317. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8IPTypeOfService[3] :0x%X ,0x%X ,0x%X ",
  1318. psfCSType->cCPacketClassificationRule.u8IPTypeOfService[0],
  1319. psfCSType->cCPacketClassificationRule.u8IPTypeOfService[1],
  1320. psfCSType->cCPacketClassificationRule.u8IPTypeOfService[2]);
  1321. for(uiLoopIndex=0; uiLoopIndex < 1; uiLoopIndex++)
  1322. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8Protocol : 0x%X ",
  1323. psfCSType->cCPacketClassificationRule.u8Protocol);
  1324. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddressLength :0x%X ",
  1325. psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddressLength);
  1326. for(uiLoopIndex=0; uiLoopIndex < 32; uiLoopIndex++)
  1327. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPMaskedSourceAddress[32]:0x%X ",
  1328. psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddress[uiLoopIndex]);
  1329. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8IPDestinationAddressLength : 0x%02X ",
  1330. psfCSType->cCPacketClassificationRule.u8IPDestinationAddressLength);
  1331. for(uiLoopIndex=0;uiLoopIndex<32;uiLoopIndex++)
  1332. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8IPDestinationAddress[32]:0x%X ",
  1333. psfCSType->cCPacketClassificationRule.u8IPDestinationAddress[uiLoopIndex]);
  1334. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ProtocolSourcePortRangeLength:0x%X ",
  1335. psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength);
  1336. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ProtocolSourcePortRange[4]:0x%X ,0x%X ,0x%X ,0x%X ",
  1337. psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[0],
  1338. psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[1],
  1339. psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[2],
  1340. psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[3]);
  1341. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ProtocolDestPortRangeLength:0x%X ",
  1342. psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength);
  1343. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8ProtocolDestPortRange[4]:0x%X ,0x%X ,0x%X ,0x%X ",
  1344. psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[0],
  1345. psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[1],
  1346. psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[2],
  1347. psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[3]);
  1348. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8EthernetDestMacAddressLength:0x%X ",
  1349. psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
  1350. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8EthernetDestMacAddress[6]:0x%X ,0x%X ,0x%X ,0x%X ,0x%X ,0x%X",
  1351. psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[0],
  1352. psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[1],
  1353. psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[2],
  1354. psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[3],
  1355. psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[4],
  1356. psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress[5]);
  1357. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8EthernetSourceMACAddressLength:0x%X ",
  1358. psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength);
  1359. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "u8EthernetSourceMACAddress[6]:0x%X ,0x%X ,0x%X ,0x%X ,0x%X ,0x%X",
  1360. psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[0],
  1361. psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[1],
  1362. psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[2],
  1363. psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[3],
  1364. psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[4],
  1365. psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress[5]);
  1366. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8EthertypeLength :0x%X ",
  1367. psfCSType->cCPacketClassificationRule.u8EthertypeLength);
  1368. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8Ethertype[3] :0x%X ,0x%X ,0x%X ",
  1369. psfCSType->cCPacketClassificationRule.u8Ethertype[0],
  1370. psfCSType->cCPacketClassificationRule.u8Ethertype[1],
  1371. psfCSType->cCPacketClassificationRule.u8Ethertype[2]);
  1372. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16UserPriority :0x%X ",
  1373. psfCSType->cCPacketClassificationRule.u16UserPriority);
  1374. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16VLANID :0x%X ",
  1375. psfCSType->cCPacketClassificationRule.u16VLANID);
  1376. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8AssociatedPHSI :0x%X ",
  1377. psfCSType->cCPacketClassificationRule.u8AssociatedPHSI);
  1378. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u16PacketClassificationRuleIndex:0x%X ",
  1379. psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex);
  1380. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8VendorSpecificClassifierParamLength:0x%X ",
  1381. psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParamLength);
  1382. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8VendorSpecificClassifierParam[1]:0x%X ",
  1383. psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParam[0]);
  1384. #ifdef VERSION_D5
  1385. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8IPv6FlowLableLength :0x%X ",
  1386. psfCSType->cCPacketClassificationRule.u8IPv6FlowLableLength);
  1387. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " u8IPv6FlowLable[6] :0x%X ,0x%X ,0x%X ,0x%X ,0x%X ,0x%X ",
  1388. psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[0],
  1389. psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[1],
  1390. psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[2],
  1391. psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[3],
  1392. psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[4],
  1393. psfCSType->cCPacketClassificationRule.u8IPv6FlowLable[5]);
  1394. #endif
  1395. }
  1396. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " bValid : 0x%X",pstAddIndication->sfActiveSet.bValid);
  1397. }
  1398. static inline ULONG RestoreSFParam(PMINI_ADAPTER Adapter, ULONG ulAddrSFParamSet,PUCHAR pucDestBuffer)
  1399. {
  1400. UINT nBytesToRead = sizeof(stServiceFlowParamSI);
  1401. if(ulAddrSFParamSet == 0 || NULL == pucDestBuffer)
  1402. {
  1403. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Got Param address as 0!!");
  1404. return 0;
  1405. }
  1406. ulAddrSFParamSet = ntohl(ulAddrSFParamSet);
  1407. //Read out the SF Param Set At the indicated Location
  1408. if(rdm(Adapter, ulAddrSFParamSet, (PUCHAR)pucDestBuffer, nBytesToRead) < 0)
  1409. return STATUS_FAILURE;
  1410. return 1;
  1411. }
  1412. static ULONG StoreSFParam(PMINI_ADAPTER Adapter,PUCHAR pucSrcBuffer,ULONG ulAddrSFParamSet)
  1413. {
  1414. UINT nBytesToWrite = sizeof(stServiceFlowParamSI);
  1415. int ret = 0;
  1416. if(ulAddrSFParamSet == 0 || NULL == pucSrcBuffer)
  1417. {
  1418. return 0;
  1419. }
  1420. ret = wrm(Adapter, ulAddrSFParamSet, (u8 *)pucSrcBuffer, nBytesToWrite);
  1421. if (ret < 0) {
  1422. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "%s:%d WRM failed",__FUNCTION__, __LINE__);
  1423. return ret;
  1424. }
  1425. return 1;
  1426. }
  1427. ULONG StoreCmControlResponseMessage(PMINI_ADAPTER Adapter,PVOID pvBuffer,UINT *puBufferLength)
  1428. {
  1429. stLocalSFAddIndicationAlt *pstAddIndicationAlt = NULL;
  1430. stLocalSFAddIndication * pstAddIndication = NULL;
  1431. stLocalSFDeleteRequest *pstDeletionRequest;
  1432. UINT uiSearchRuleIndex;
  1433. ULONG ulSFID;
  1434. pstAddIndicationAlt = (stLocalSFAddIndicationAlt *)(pvBuffer);
  1435. /*
  1436. * In case of DSD Req By MS, we should immediately delete this SF so that
  1437. * we can stop the further classifying the pkt for this SF.
  1438. */
  1439. if(pstAddIndicationAlt->u8Type == DSD_REQ)
  1440. {
  1441. pstDeletionRequest = (stLocalSFDeleteRequest *)pvBuffer;
  1442. ulSFID = ntohl(pstDeletionRequest->u32SFID);
  1443. uiSearchRuleIndex=SearchSfid(Adapter,ulSFID);
  1444. if(uiSearchRuleIndex < NO_OF_QUEUES)
  1445. {
  1446. deleteSFBySfid(Adapter,uiSearchRuleIndex);
  1447. Adapter->u32TotalDSD++;
  1448. }
  1449. return 1;
  1450. }
  1451. if( (pstAddIndicationAlt->u8Type == DSD_RSP) ||
  1452. (pstAddIndicationAlt->u8Type == DSD_ACK))
  1453. {
  1454. //No Special handling send the message as it is
  1455. return 1;
  1456. }
  1457. // For DSA_REQ, only up to "psfAuthorizedSet" parameter should be accessed by driver!
  1458. pstAddIndication=kmalloc(sizeof(*pstAddIndication), GFP_KERNEL);
  1459. if(NULL==pstAddIndication)
  1460. return 0;
  1461. /* AUTHORIZED SET */
  1462. pstAddIndication->psfAuthorizedSet = (stServiceFlowParamSI *)
  1463. GetNextTargetBufferLocation(Adapter, pstAddIndicationAlt->u16TID);
  1464. if(!pstAddIndication->psfAuthorizedSet)
  1465. return 0;
  1466. if(StoreSFParam(Adapter,(PUCHAR)&pstAddIndicationAlt->sfAuthorizedSet,
  1467. (ULONG)pstAddIndication->psfAuthorizedSet)!= 1)
  1468. return 0;
  1469. /* this can't possibly be right */
  1470. pstAddIndication->psfAuthorizedSet = (stServiceFlowParamSI *)ntohl((ULONG)pstAddIndication->psfAuthorizedSet);
  1471. if(pstAddIndicationAlt->u8Type == DSA_REQ)
  1472. {
  1473. stLocalSFAddRequest AddRequest;
  1474. AddRequest.u8Type = pstAddIndicationAlt->u8Type;
  1475. AddRequest.eConnectionDir = pstAddIndicationAlt->u8Direction;
  1476. AddRequest.u16TID = pstAddIndicationAlt->u16TID;
  1477. AddRequest.u16CID = pstAddIndicationAlt->u16CID;
  1478. AddRequest.u16VCID = pstAddIndicationAlt->u16VCID;
  1479. AddRequest.psfParameterSet =pstAddIndication->psfAuthorizedSet ;
  1480. (*puBufferLength) = sizeof(stLocalSFAddRequest);
  1481. memcpy(pvBuffer,&AddRequest,sizeof(stLocalSFAddRequest));
  1482. return 1;
  1483. }
  1484. // Since it's not DSA_REQ, we can access all field in pstAddIndicationAlt
  1485. //We need to extract the structure from the buffer and pack it differently
  1486. pstAddIndication->u8Type = pstAddIndicationAlt->u8Type;
  1487. pstAddIndication->eConnectionDir= pstAddIndicationAlt->u8Direction ;
  1488. pstAddIndication->u16TID = pstAddIndicationAlt->u16TID;
  1489. pstAddIndication->u16CID = pstAddIndicationAlt->u16CID;
  1490. pstAddIndication->u16VCID = pstAddIndicationAlt->u16VCID;
  1491. pstAddIndication->u8CC = pstAddIndicationAlt->u8CC;
  1492. /* ADMITTED SET */
  1493. pstAddIndication->psfAdmittedSet = (stServiceFlowParamSI *)
  1494. GetNextTargetBufferLocation(Adapter, pstAddIndicationAlt->u16TID);
  1495. if(!pstAddIndication->psfAdmittedSet)
  1496. return 0;
  1497. if(StoreSFParam(Adapter,(PUCHAR)&pstAddIndicationAlt->sfAdmittedSet,(ULONG)pstAddIndication->psfAdmittedSet) != 1)
  1498. return 0;
  1499. pstAddIndication->psfAdmittedSet = (stServiceFlowParamSI *)ntohl((ULONG)pstAddIndication->psfAdmittedSet);
  1500. /* ACTIVE SET */
  1501. pstAddIndication->psfActiveSet = (stServiceFlowParamSI *)
  1502. GetNextTargetBufferLocation(Adapter, pstAddIndicationAlt->u16TID);
  1503. if(!pstAddIndication->psfActiveSet)
  1504. return 0;
  1505. if(StoreSFParam(Adapter,(PUCHAR)&pstAddIndicationAlt->sfActiveSet,(ULONG)pstAddIndication->psfActiveSet) != 1)
  1506. return 0;
  1507. pstAddIndication->psfActiveSet = (stServiceFlowParamSI *)ntohl((ULONG)pstAddIndication->psfActiveSet);
  1508. (*puBufferLength) = sizeof(stLocalSFAddIndication);
  1509. *(stLocalSFAddIndication *)pvBuffer = *pstAddIndication;
  1510. kfree(pstAddIndication);
  1511. return 1;
  1512. }
  1513. static inline stLocalSFAddIndicationAlt
  1514. *RestoreCmControlResponseMessage(register PMINI_ADAPTER Adapter,register PVOID pvBuffer)
  1515. {
  1516. ULONG ulStatus=0;
  1517. stLocalSFAddIndication *pstAddIndication = NULL;
  1518. stLocalSFAddIndicationAlt *pstAddIndicationDest = NULL;
  1519. pstAddIndication = (stLocalSFAddIndication *)(pvBuffer);
  1520. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "=====>" );
  1521. if ((pstAddIndication->u8Type == DSD_REQ) ||
  1522. (pstAddIndication->u8Type == DSD_RSP) ||
  1523. (pstAddIndication->u8Type == DSD_ACK))
  1524. {
  1525. return (stLocalSFAddIndicationAlt *)pvBuffer;
  1526. }
  1527. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Inside RestoreCmControlResponseMessage ");
  1528. /*
  1529. //Need to Allocate memory to contain the SUPER Large structures
  1530. //Our driver can't create these structures on Stack :(
  1531. */
  1532. pstAddIndicationDest=kmalloc(sizeof(stLocalSFAddIndicationAlt), GFP_KERNEL);
  1533. if(pstAddIndicationDest)
  1534. {
  1535. memset(pstAddIndicationDest,0,sizeof(stLocalSFAddIndicationAlt));
  1536. }
  1537. else
  1538. {
  1539. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Failed to allocate memory for SF Add Indication Structure ");
  1540. return NULL;
  1541. }
  1542. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u8Type : 0x%X",pstAddIndication->u8Type);
  1543. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u8Direction : 0x%X",pstAddIndication->eConnectionDir);
  1544. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u8TID : 0x%X",ntohs(pstAddIndication->u16TID));
  1545. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u8CID : 0x%X",ntohs(pstAddIndication->u16CID));
  1546. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-u16VCID : 0x%X",ntohs(pstAddIndication->u16VCID));
  1547. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-autorized set loc : %p",pstAddIndication->psfAuthorizedSet);
  1548. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-admitted set loc : %p",pstAddIndication->psfAdmittedSet);
  1549. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "AddIndication-Active set loc : %p",pstAddIndication->psfActiveSet);
  1550. pstAddIndicationDest->u8Type = pstAddIndication->u8Type;
  1551. pstAddIndicationDest->u8Direction = pstAddIndication->eConnectionDir;
  1552. pstAddIndicationDest->u16TID = pstAddIndication->u16TID;
  1553. pstAddIndicationDest->u16CID = pstAddIndication->u16CID;
  1554. pstAddIndicationDest->u16VCID = pstAddIndication->u16VCID;
  1555. pstAddIndicationDest->u8CC = pstAddIndication->u8CC;
  1556. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Restoring Active Set ");
  1557. ulStatus=RestoreSFParam(Adapter,(ULONG)pstAddIndication->psfActiveSet, (PUCHAR)&pstAddIndicationDest->sfActiveSet);
  1558. if(ulStatus != 1)
  1559. {
  1560. goto failed_restore_sf_param;
  1561. }
  1562. if(pstAddIndicationDest->sfActiveSet.u8TotalClassifiers > MAX_CLASSIFIERS_IN_SF)
  1563. pstAddIndicationDest->sfActiveSet.u8TotalClassifiers = MAX_CLASSIFIERS_IN_SF;
  1564. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Restoring Admitted Set ");
  1565. ulStatus=RestoreSFParam(Adapter,(ULONG)pstAddIndication->psfAdmittedSet,(PUCHAR)&pstAddIndicationDest->sfAdmittedSet);
  1566. if(ulStatus != 1)
  1567. {
  1568. goto failed_restore_sf_param;
  1569. }
  1570. if(pstAddIndicationDest->sfAdmittedSet.u8TotalClassifiers > MAX_CLASSIFIERS_IN_SF)
  1571. pstAddIndicationDest->sfAdmittedSet.u8TotalClassifiers = MAX_CLASSIFIERS_IN_SF;
  1572. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Restoring Authorized Set ");
  1573. ulStatus=RestoreSFParam(Adapter,(ULONG)pstAddIndication->psfAuthorizedSet,(PUCHAR)&pstAddIndicationDest->sfAuthorizedSet);
  1574. if(ulStatus != 1)
  1575. {
  1576. goto failed_restore_sf_param;
  1577. }
  1578. if(pstAddIndicationDest->sfAuthorizedSet.u8TotalClassifiers > MAX_CLASSIFIERS_IN_SF)
  1579. pstAddIndicationDest->sfAuthorizedSet.u8TotalClassifiers = MAX_CLASSIFIERS_IN_SF;
  1580. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Dumping the whole raw packet");
  1581. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "============================================================");
  1582. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " pstAddIndicationDest->sfActiveSet size %zx %p", sizeof(*pstAddIndicationDest), pstAddIndicationDest);
  1583. //BCM_DEBUG_PRINT_BUFFER(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, (unsigned char *)pstAddIndicationDest, sizeof(*pstAddIndicationDest));
  1584. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "============================================================");
  1585. return pstAddIndicationDest;
  1586. failed_restore_sf_param:
  1587. kfree(pstAddIndicationDest);
  1588. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "<=====" );
  1589. return NULL;
  1590. }
  1591. ULONG SetUpTargetDsxBuffers(PMINI_ADAPTER Adapter)
  1592. {
  1593. ULONG ulTargetDsxBuffersBase = 0;
  1594. ULONG ulCntTargetBuffers;
  1595. ULONG ulIndex=0;
  1596. int Status;
  1597. if (!Adapter) {
  1598. BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Adapter was NULL!!!");
  1599. return 0;
  1600. }
  1601. if(Adapter->astTargetDsxBuffer[0].ulTargetDsxBuffer)
  1602. return 1;
  1603. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Size of Each DSX Buffer(Also size of ServiceFlowParamSI): %zx ",sizeof(stServiceFlowParamSI));
  1604. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Reading DSX buffer From Target location %x ",DSX_MESSAGE_EXCHANGE_BUFFER);
  1605. Status = rdmalt(Adapter, DSX_MESSAGE_EXCHANGE_BUFFER,
  1606. (PUINT)&ulTargetDsxBuffersBase, sizeof(UINT));
  1607. if(Status < 0)
  1608. {
  1609. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "RDM failed!!");
  1610. return 0;
  1611. }
  1612. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Base Address Of DSX Target Buffer : 0x%lx",ulTargetDsxBuffersBase);
  1613. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Tgt Buffer is Now %lx :",ulTargetDsxBuffersBase);
  1614. ulCntTargetBuffers = DSX_MESSAGE_EXCHANGE_BUFFER_SIZE/sizeof(stServiceFlowParamSI);
  1615. Adapter->ulTotalTargetBuffersAvailable =
  1616. ulCntTargetBuffers > MAX_TARGET_DSX_BUFFERS ?
  1617. MAX_TARGET_DSX_BUFFERS : ulCntTargetBuffers;
  1618. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " Total Target DSX Buffer setup %lx ",Adapter->ulTotalTargetBuffersAvailable);
  1619. for(ulIndex=0; ulIndex < Adapter->ulTotalTargetBuffersAvailable ; ulIndex++)
  1620. {
  1621. Adapter->astTargetDsxBuffer[ulIndex].ulTargetDsxBuffer = ulTargetDsxBuffersBase;
  1622. Adapter->astTargetDsxBuffer[ulIndex].valid=1;
  1623. Adapter->astTargetDsxBuffer[ulIndex].tid=0;
  1624. ulTargetDsxBuffersBase+=sizeof(stServiceFlowParamSI);
  1625. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " Target DSX Buffer %lx setup at 0x%lx",
  1626. ulIndex, Adapter->astTargetDsxBuffer[ulIndex].ulTargetDsxBuffer);
  1627. }
  1628. Adapter->ulCurrentTargetBuffer = 0;
  1629. Adapter->ulFreeTargetBufferCnt = Adapter->ulTotalTargetBuffersAvailable;
  1630. return 1;
  1631. }
  1632. static ULONG GetNextTargetBufferLocation(PMINI_ADAPTER Adapter,B_UINT16 tid)
  1633. {
  1634. ULONG ulTargetDSXBufferAddress;
  1635. ULONG ulTargetDsxBufferIndexToUse,ulMaxTry;
  1636. if((Adapter->ulTotalTargetBuffersAvailable == 0)||
  1637. (Adapter->ulFreeTargetBufferCnt == 0))
  1638. {
  1639. ClearTargetDSXBuffer(Adapter,tid,FALSE);
  1640. return 0;
  1641. }
  1642. ulTargetDsxBufferIndexToUse = Adapter->ulCurrentTargetBuffer;
  1643. ulMaxTry = Adapter->ulTotalTargetBuffersAvailable;
  1644. while((ulMaxTry)&&(Adapter->astTargetDsxBuffer[ulTargetDsxBufferIndexToUse].valid != 1))
  1645. {
  1646. ulTargetDsxBufferIndexToUse = (ulTargetDsxBufferIndexToUse+1)%
  1647. Adapter->ulTotalTargetBuffersAvailable;
  1648. ulMaxTry--;
  1649. }
  1650. if(ulMaxTry==0)
  1651. {
  1652. BCM_DEBUG_PRINT (Adapter, DBG_TYPE_PRINTK, 0, 0, "\n GetNextTargetBufferLocation : Error No Free Target DSX Buffers FreeCnt : %lx ",Adapter->ulFreeTargetBufferCnt);
  1653. ClearTargetDSXBuffer(Adapter,tid,FALSE);
  1654. return 0;
  1655. }
  1656. ulTargetDSXBufferAddress =
  1657. Adapter->astTargetDsxBuffer[ulTargetDsxBufferIndexToUse].ulTargetDsxBuffer;
  1658. Adapter->astTargetDsxBuffer[ulTargetDsxBufferIndexToUse].valid=0;
  1659. Adapter->astTargetDsxBuffer[ulTargetDsxBufferIndexToUse].tid=tid;
  1660. Adapter->ulFreeTargetBufferCnt--;
  1661. ulTargetDsxBufferIndexToUse =
  1662. (ulTargetDsxBufferIndexToUse+1)%Adapter->ulTotalTargetBuffersAvailable;
  1663. Adapter->ulCurrentTargetBuffer = ulTargetDsxBufferIndexToUse;
  1664. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "GetNextTargetBufferLocation :Returning address %lx tid %d\n",
  1665. ulTargetDSXBufferAddress,tid);
  1666. return ulTargetDSXBufferAddress;
  1667. }
  1668. INT AllocAdapterDsxBuffer(PMINI_ADAPTER Adapter)
  1669. {
  1670. /*
  1671. //Need to Allocate memory to contain the SUPER Large structures
  1672. //Our driver can't create these structures on Stack
  1673. */
  1674. Adapter->caDsxReqResp=kmalloc(sizeof(stLocalSFAddIndicationAlt)+LEADER_SIZE, GFP_KERNEL);
  1675. if(!Adapter->caDsxReqResp)
  1676. return -ENOMEM;
  1677. return 0;
  1678. }
  1679. INT FreeAdapterDsxBuffer(PMINI_ADAPTER Adapter)
  1680. {
  1681. kfree(Adapter->caDsxReqResp);
  1682. return 0;
  1683. }
  1684. /**
  1685. @ingroup ctrl_pkt_functions
  1686. This routinue would process the Control responses
  1687. for the Connection Management.
  1688. @return - Queue index for the free SFID else returns Invalid Index.
  1689. */
  1690. BOOLEAN CmControlResponseMessage(PMINI_ADAPTER Adapter, /**<Pointer to the Adapter structure*/
  1691. PVOID pvBuffer /**Starting Address of the Buffer, that contains the AddIndication Data*/
  1692. )
  1693. {
  1694. stServiceFlowParamSI *psfLocalSet=NULL;
  1695. stLocalSFAddIndicationAlt *pstAddIndication = NULL;
  1696. stLocalSFChangeIndicationAlt *pstChangeIndication = NULL;
  1697. PLEADER pLeader=NULL;
  1698. /*
  1699. //Otherwise the message contains a target address from where we need to
  1700. //read out the rest of the service flow param structure
  1701. */
  1702. if((pstAddIndication = RestoreCmControlResponseMessage(Adapter,pvBuffer))
  1703. == NULL)
  1704. {
  1705. ClearTargetDSXBuffer(Adapter,((stLocalSFAddIndication *)pvBuffer)->u16TID, FALSE);
  1706. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_PRINTK, 0, 0, "Error in restoring Service Flow param structure from DSx message");
  1707. return FALSE;
  1708. }
  1709. DumpCmControlPacket(pstAddIndication);
  1710. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "====>");
  1711. pLeader = (PLEADER)Adapter->caDsxReqResp;
  1712. pLeader->Status =CM_CONTROL_NEWDSX_MULTICLASSIFIER_REQ;
  1713. pLeader->Vcid = 0;
  1714. ClearTargetDSXBuffer(Adapter,pstAddIndication->u16TID,FALSE);
  1715. BCM_DEBUG_PRINT (Adapter, DBG_TYPE_PRINTK, 0, 0, "### TID RECEIVED %d\n",pstAddIndication->u16TID);
  1716. switch(pstAddIndication->u8Type)
  1717. {
  1718. case DSA_REQ:
  1719. {
  1720. pLeader->PLength = sizeof(stLocalSFAddIndicationAlt);
  1721. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Sending DSA Response....\n");
  1722. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSA RESPONSE TO MAC %d", pLeader->PLength );
  1723. *((stLocalSFAddIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE]))
  1724. = *pstAddIndication;
  1725. ((stLocalSFAddIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSA_RSP;
  1726. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " VCID = %x", ntohs(pstAddIndication->u16VCID));
  1727. CopyBufferToControlPacket(Adapter,(PVOID)Adapter->caDsxReqResp);
  1728. kfree(pstAddIndication);
  1729. }
  1730. break;
  1731. case DSA_RSP:
  1732. {
  1733. pLeader->PLength = sizeof(stLocalSFAddIndicationAlt);
  1734. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSA ACK TO MAC %d",
  1735. pLeader->PLength);
  1736. *((stLocalSFAddIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE]))
  1737. = *pstAddIndication;
  1738. ((stLocalSFAddIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSA_ACK;
  1739. }//no break here..we should go down.
  1740. case DSA_ACK:
  1741. {
  1742. UINT uiSearchRuleIndex=0;
  1743. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "VCID:0x%X",
  1744. ntohs(pstAddIndication->u16VCID));
  1745. uiSearchRuleIndex=SearchFreeSfid(Adapter);
  1746. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"uiSearchRuleIndex:0x%X ",
  1747. uiSearchRuleIndex);
  1748. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Direction:0x%X ",
  1749. pstAddIndication->u8Direction);
  1750. if((uiSearchRuleIndex< NO_OF_QUEUES) )
  1751. {
  1752. Adapter->PackInfo[uiSearchRuleIndex].ucDirection =
  1753. pstAddIndication->u8Direction;
  1754. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "bValid:0x%X ",
  1755. pstAddIndication->sfActiveSet.bValid);
  1756. if(pstAddIndication->sfActiveSet.bValid==TRUE)
  1757. {
  1758. Adapter->PackInfo[uiSearchRuleIndex].bActiveSet=TRUE;
  1759. }
  1760. if(pstAddIndication->sfAuthorizedSet.bValid==TRUE)
  1761. {
  1762. Adapter->PackInfo[uiSearchRuleIndex].bAuthorizedSet=TRUE;
  1763. }
  1764. if(pstAddIndication->sfAdmittedSet.bValid==TRUE)
  1765. {
  1766. Adapter->PackInfo[uiSearchRuleIndex].bAdmittedSet=TRUE;
  1767. }
  1768. if(FALSE == pstAddIndication->sfActiveSet.bValid)
  1769. {
  1770. Adapter->PackInfo[uiSearchRuleIndex].bActive = FALSE;
  1771. Adapter->PackInfo[uiSearchRuleIndex].bActivateRequestSent = FALSE;
  1772. if(pstAddIndication->sfAdmittedSet.bValid)
  1773. {
  1774. psfLocalSet = &pstAddIndication->sfAdmittedSet;
  1775. }
  1776. else if(pstAddIndication->sfAuthorizedSet.bValid)
  1777. {
  1778. psfLocalSet = &pstAddIndication->sfAuthorizedSet;
  1779. }
  1780. }
  1781. else
  1782. {
  1783. psfLocalSet = &pstAddIndication->sfActiveSet;
  1784. Adapter->PackInfo[uiSearchRuleIndex].bActive=TRUE;
  1785. }
  1786. if(!psfLocalSet)
  1787. {
  1788. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "No set is valid\n");
  1789. Adapter->PackInfo[uiSearchRuleIndex].bActive=FALSE;
  1790. Adapter->PackInfo[uiSearchRuleIndex].bValid=FALSE;
  1791. Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value=0;
  1792. kfree(pstAddIndication);
  1793. }
  1794. else if(psfLocalSet->bValid && (pstAddIndication->u8CC == 0))
  1795. {
  1796. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "DSA ACK");
  1797. Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value =
  1798. ntohs(pstAddIndication->u16VCID);
  1799. Adapter->PackInfo[uiSearchRuleIndex].usCID =
  1800. ntohs(pstAddIndication->u16CID);
  1801. if(UPLINK_DIR == pstAddIndication->u8Direction)
  1802. atomic_set(&Adapter->PackInfo[uiSearchRuleIndex].uiPerSFTxResourceCount, DEFAULT_PERSFCOUNT);
  1803. CopyToAdapter(Adapter,psfLocalSet,uiSearchRuleIndex,
  1804. DSA_ACK, pstAddIndication);
  1805. // don't free pstAddIndication
  1806. /* Inside CopyToAdapter, Sorting of all the SFs take place.
  1807. Hence any access to the newly added SF through uiSearchRuleIndex is invalid.
  1808. SHOULD BE STRICTLY AVOIDED.
  1809. */
  1810. // *(PULONG)(((PUCHAR)pvBuffer)+1)=psfLocalSet->u32SFID;
  1811. memcpy((((PUCHAR)pvBuffer)+1), &psfLocalSet->u32SFID, 4);
  1812. if(pstAddIndication->sfActiveSet.bValid == TRUE)
  1813. {
  1814. if(UPLINK_DIR == pstAddIndication->u8Direction)
  1815. {
  1816. if(!Adapter->LinkUpStatus)
  1817. {
  1818. netif_carrier_on(Adapter->dev);
  1819. netif_start_queue(Adapter->dev);
  1820. Adapter->LinkUpStatus = 1;
  1821. if (netif_msg_link(Adapter))
  1822. pr_info(PFX "%s: link up\n", Adapter->dev->name);
  1823. atomic_set(&Adapter->TxPktAvail, 1);
  1824. wake_up(&Adapter->tx_packet_wait_queue);
  1825. Adapter->liTimeSinceLastNetEntry = get_seconds();
  1826. }
  1827. }
  1828. }
  1829. }
  1830. else
  1831. {
  1832. Adapter->PackInfo[uiSearchRuleIndex].bActive=FALSE;
  1833. Adapter->PackInfo[uiSearchRuleIndex].bValid=FALSE;
  1834. Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value=0;
  1835. kfree(pstAddIndication);
  1836. }
  1837. }
  1838. else
  1839. {
  1840. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_PRINTK, 0, 0, "DSA ACK did not get valid SFID");
  1841. kfree(pstAddIndication);
  1842. return FALSE;
  1843. }
  1844. }
  1845. break;
  1846. case DSC_REQ:
  1847. {
  1848. pLeader->PLength = sizeof(stLocalSFChangeIndicationAlt);
  1849. pstChangeIndication = (stLocalSFChangeIndicationAlt*)pstAddIndication;
  1850. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSC RESPONSE TO MAC %d", pLeader->PLength);
  1851. *((stLocalSFChangeIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE])) = *pstChangeIndication;
  1852. ((stLocalSFChangeIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSC_RSP;
  1853. CopyBufferToControlPacket(Adapter,(PVOID)Adapter->caDsxReqResp);
  1854. kfree(pstAddIndication);
  1855. }
  1856. break;
  1857. case DSC_RSP:
  1858. {
  1859. pLeader->PLength = sizeof(stLocalSFChangeIndicationAlt);
  1860. pstChangeIndication = (stLocalSFChangeIndicationAlt*)pstAddIndication;
  1861. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSC ACK TO MAC %d", pLeader->PLength);
  1862. *((stLocalSFChangeIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE])) = *pstChangeIndication;
  1863. ((stLocalSFChangeIndicationAlt*)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSC_ACK;
  1864. }
  1865. case DSC_ACK:
  1866. {
  1867. UINT uiSearchRuleIndex=0;
  1868. pstChangeIndication = (stLocalSFChangeIndicationAlt *)pstAddIndication;
  1869. uiSearchRuleIndex=SearchSfid(Adapter,ntohl(pstChangeIndication->sfActiveSet.u32SFID));
  1870. if(uiSearchRuleIndex > NO_OF_QUEUES-1)
  1871. {
  1872. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_PRINTK, 0, 0, "SF doesn't exist for which DSC_ACK is received");
  1873. }
  1874. if((uiSearchRuleIndex < NO_OF_QUEUES))
  1875. {
  1876. Adapter->PackInfo[uiSearchRuleIndex].ucDirection = pstChangeIndication->u8Direction;
  1877. if(pstChangeIndication->sfActiveSet.bValid==TRUE)
  1878. {
  1879. Adapter->PackInfo[uiSearchRuleIndex].bActiveSet=TRUE;
  1880. }
  1881. if(pstChangeIndication->sfAuthorizedSet.bValid==TRUE)
  1882. {
  1883. Adapter->PackInfo[uiSearchRuleIndex].bAuthorizedSet=TRUE;
  1884. }
  1885. if(pstChangeIndication->sfAdmittedSet.bValid==TRUE)
  1886. {
  1887. Adapter->PackInfo[uiSearchRuleIndex].bAdmittedSet=TRUE;
  1888. }
  1889. if(FALSE==pstChangeIndication->sfActiveSet.bValid)
  1890. {
  1891. Adapter->PackInfo[uiSearchRuleIndex].bActive = FALSE;
  1892. Adapter->PackInfo[uiSearchRuleIndex].bActivateRequestSent = FALSE;
  1893. if(pstChangeIndication->sfAdmittedSet.bValid)
  1894. {
  1895. psfLocalSet = &pstChangeIndication->sfAdmittedSet;
  1896. }
  1897. else if(pstChangeIndication->sfAuthorizedSet.bValid)
  1898. {
  1899. psfLocalSet = &pstChangeIndication->sfAuthorizedSet;
  1900. }
  1901. }
  1902. else
  1903. {
  1904. psfLocalSet = &pstChangeIndication->sfActiveSet;
  1905. Adapter->PackInfo[uiSearchRuleIndex].bActive=TRUE;
  1906. }
  1907. if(psfLocalSet->bValid && (pstChangeIndication->u8CC == 0))
  1908. {
  1909. Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value =
  1910. ntohs(pstChangeIndication->u16VCID);
  1911. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "CC field is %d bvalid = %d\n",
  1912. pstChangeIndication->u8CC, psfLocalSet->bValid);
  1913. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "VCID= %d\n", ntohs(pstChangeIndication->u16VCID));
  1914. Adapter->PackInfo[uiSearchRuleIndex].usCID =
  1915. ntohs(pstChangeIndication->u16CID);
  1916. CopyToAdapter(Adapter,psfLocalSet,uiSearchRuleIndex,
  1917. DSC_ACK, pstAddIndication);
  1918. *(PULONG)(((PUCHAR)pvBuffer)+1)=psfLocalSet->u32SFID;
  1919. }
  1920. else if(pstChangeIndication->u8CC == 6)
  1921. {
  1922. deleteSFBySfid(Adapter,uiSearchRuleIndex);
  1923. kfree(pstAddIndication);
  1924. }
  1925. }
  1926. else
  1927. {
  1928. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_PRINTK, 0, 0, "DSC ACK did not get valid SFID");
  1929. kfree(pstAddIndication);
  1930. return FALSE;
  1931. }
  1932. }
  1933. break;
  1934. case DSD_REQ:
  1935. {
  1936. UINT uiSearchRuleIndex;
  1937. ULONG ulSFID;
  1938. pLeader->PLength = sizeof(stLocalSFDeleteIndication);
  1939. *((stLocalSFDeleteIndication*)&(Adapter->caDsxReqResp[LEADER_SIZE])) = *((stLocalSFDeleteIndication*)pstAddIndication);
  1940. ulSFID = ntohl(((stLocalSFDeleteIndication*)pstAddIndication)->u32SFID);
  1941. uiSearchRuleIndex=SearchSfid(Adapter,ulSFID);
  1942. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "DSD - Removing connection %x",uiSearchRuleIndex);
  1943. if(uiSearchRuleIndex < NO_OF_QUEUES)
  1944. {
  1945. //Delete All Classifiers Associated with this SFID
  1946. deleteSFBySfid(Adapter,uiSearchRuleIndex);
  1947. Adapter->u32TotalDSD++;
  1948. }
  1949. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SENDING DSD RESPONSE TO MAC");
  1950. ((stLocalSFDeleteIndication*)&(Adapter->caDsxReqResp[LEADER_SIZE]))->u8Type = DSD_RSP;
  1951. CopyBufferToControlPacket(Adapter,(PVOID)Adapter->caDsxReqResp);
  1952. }
  1953. case DSD_RSP:
  1954. {
  1955. //Do nothing as SF has already got Deleted
  1956. }
  1957. break;
  1958. case DSD_ACK:
  1959. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "DSD ACK Rcd, let App handle it\n");
  1960. break;
  1961. default:
  1962. kfree(pstAddIndication);
  1963. return FALSE ;
  1964. }
  1965. return TRUE;
  1966. }
  1967. int get_dsx_sf_data_to_application(PMINI_ADAPTER Adapter, UINT uiSFId, void __user *user_buffer)
  1968. {
  1969. int status = 0;
  1970. struct _packet_info *psSfInfo=NULL;
  1971. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "status =%d",status);
  1972. status = SearchSfid(Adapter, uiSFId);
  1973. if (status >= NO_OF_QUEUES) {
  1974. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "SFID %d not present in queue !!!", uiSFId );
  1975. return -EINVAL;
  1976. }
  1977. BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "status =%d",status);
  1978. psSfInfo=&Adapter->PackInfo[status];
  1979. if(psSfInfo->pstSFIndication && copy_to_user(user_buffer,
  1980. psSfInfo->pstSFIndication, sizeof(stLocalSFAddIndicationAlt)))
  1981. {
  1982. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "copy to user failed SFID %d, present in queue !!!", uiSFId );
  1983. status = -EFAULT;
  1984. return status;
  1985. }
  1986. return STATUS_SUCCESS;
  1987. }
  1988. VOID OverrideServiceFlowParams(PMINI_ADAPTER Adapter,PUINT puiBuffer)
  1989. {
  1990. B_UINT32 u32NumofSFsinMsg = ntohl(*(puiBuffer + 1));
  1991. stIM_SFHostNotify *pHostInfo = NULL;
  1992. UINT uiSearchRuleIndex = 0;
  1993. ULONG ulSFID = 0;
  1994. puiBuffer+=2;
  1995. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "u32NumofSFsinMsg: 0x%x\n",u32NumofSFsinMsg);
  1996. while(u32NumofSFsinMsg != 0 && u32NumofSFsinMsg < NO_OF_QUEUES)
  1997. {
  1998. u32NumofSFsinMsg--;
  1999. pHostInfo = (stIM_SFHostNotify *)puiBuffer;
  2000. puiBuffer = (PUINT)(pHostInfo + 1);
  2001. ulSFID = ntohl(pHostInfo->SFID);
  2002. uiSearchRuleIndex=SearchSfid(Adapter,ulSFID);
  2003. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"SFID: 0x%lx\n",ulSFID);
  2004. if(uiSearchRuleIndex >= NO_OF_QUEUES || uiSearchRuleIndex == HiPriority)
  2005. {
  2006. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"The SFID <%lx> doesn't exist in host entry or is Invalid\n", ulSFID);
  2007. continue;
  2008. }
  2009. if(pHostInfo->RetainSF == FALSE)
  2010. {
  2011. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"Going to Delete SF");
  2012. deleteSFBySfid(Adapter,uiSearchRuleIndex);
  2013. }
  2014. else
  2015. {
  2016. Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value = ntohs(pHostInfo->VCID);
  2017. Adapter->PackInfo[uiSearchRuleIndex].usCID = ntohs(pHostInfo->newCID);
  2018. Adapter->PackInfo[uiSearchRuleIndex].bActive=FALSE;
  2019. BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,"pHostInfo->QoSParamSet: 0x%x\n",pHostInfo->QoSParamSet);
  2020. if(pHostInfo->QoSParamSet & 0x1)
  2021. Adapter->PackInfo[uiSearchRuleIndex].bAuthorizedSet =TRUE;
  2022. if(pHostInfo->QoSParamSet & 0x2)
  2023. Adapter->PackInfo[uiSearchRuleIndex].bAdmittedSet =TRUE;
  2024. if(pHostInfo->QoSParamSet & 0x4)
  2025. {
  2026. Adapter->PackInfo[uiSearchRuleIndex].bActiveSet =TRUE;
  2027. Adapter->PackInfo[uiSearchRuleIndex].bActive=TRUE;
  2028. }
  2029. }
  2030. }
  2031. }