CmHost.c 96 KB

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