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