Lines Matching refs:header
49 /* Generate WLAN MAC header and LLC header. */
58 /* length of removed Ethernet header */
64 u16_t zfTxGenWlanHeader(zdev_t* dev, zbuf_t* buf, u16_t* header, u16_t seq,
95 /* Generate WLAN header */
97 header[4] = 0x0008 | (flag<<8);
99 header[5] = 0x0000;
104 header[4] |= 0x0100;
109 header[4] |= 0x1000;
113 header[6] = wd->sta.bssid[0];
114 header[7] = wd->sta.bssid[1];
115 header[8] = wd->sta.bssid[2];
117 header[12] = da[0];
118 header[13] = da[1];
119 header[14] = da[2];
124 header[6] = da[0];
125 header[7] = da[1];
126 header[8] = da[2];
128 header[12] = 0;
129 header[13] = 0;
130 header[14] = 0;
136 header[4] |= 0x0300;
139 header[16] = 0;
140 header[17] = 0;
141 header[18] = 0;
149 header[6] = da[0];
150 header[7] = da[1];
151 header[8] = da[2];
153 header[12] = wd->sta.bssid[0];
154 header[13] = wd->sta.bssid[1];
155 header[14] = wd->sta.bssid[2];
173 header[4] |= 0x0200;
176 header[6] = da[0];
177 header[7] = da[1];
178 header[8] = da[2];
180 header[12] = sa[0];
181 header[13] = sa[1];
182 header[14] = sa[2];
187 header[14] += (vap<<8);
194 header[4] |= 0x0300;
199 header[6] = wd->ap.wds.macAddr[wdsPortId][0];
200 header[7] = wd->ap.wds.macAddr[wdsPortId][1];
201 header[8] = wd->ap.wds.macAddr[wdsPortId][2];
203 header[12] = da[0];
204 header[13] = da[1];
205 header[14] = da[2];
207 header[16] = sa[0];
208 header[17] = sa[1];
209 header[18] = sa[2];
216 header[9] = wd->macAddr[0];
217 header[10] = wd->macAddr[1];
219 header[11] = wd->macAddr[2]; //Multiple SSID
221 header[11] = wd->macAddr[2] + (vap<<8); //VAP
226 header[9] = sa[0];
227 header[10] = sa[1];
228 header[11] = sa[2];
232 header[15] = seq;
246 header[4] |= 0x0080;
249 header[hlen] = up;
276 if (wd->enableAggregation==2 && !(header[6]&0x1))
279 header[4] |= 0x0080;
282 header[hlen] = 0;
299 if (wd->enableAggregation==0 && !(header[6]&0x1))
301 header[4] |= 0x0080;
306 header[hlen] = 0;
321 if ((header[6] & 0x1) == 0x1)
340 if ((header[6] & 0x1) == 0x1)
354 header[hlen] = ((u16_t)b2 << 8) + b1;
357 header[hlen+1] = ((u16_t)b2 << 8) + b1;
358 header[hlen+2] = (u16_t) wd->ap.iv32[vap];
359 header[hlen+3] = (u16_t) (wd->ap.iv32[vap] >> 16);
373 header[4] |= 0x4000;
387 header[hlen] = ((u16_t)b2 << 8) + b1;
388 header[hlen+1] = 0x2000 | (wd->ap.bcKeyIndex[vap] << 14);
389 header[hlen+2] = (u16_t) (wd->ap.iv32[vap]);
390 header[hlen+3] = (u16_t) (wd->ap.iv32[vap] >> 16);
395 header[4] |= 0x4000;
427 header[hlen] = (wd->ap.bcKeyIndex[vap] & 0x0001); /* For Key Id and reserved field */
428 header[hlen+1] = (u16_t)wd->ap.txiv[vap][0];
429 header[hlen+2] = (u16_t)(wd->ap.txiv[vap][0] >> 16);
430 header[hlen+3] = (u16_t)wd->ap.txiv[vap][1];
431 header[hlen+4] = (u16_t)(wd->ap.txiv[vap][1] >> 16);
432 header[hlen+5] = (u16_t)wd->ap.txiv[vap][2];
433 header[hlen+6] = (u16_t)(wd->ap.txiv[vap][2] >> 16);
434 header[hlen+7] = (u16_t)wd->ap.txiv[vap][3];
435 header[hlen+8] = (u16_t)(wd->ap.txiv[vap][3] >> 16);
440 header[4] |= 0x4000;
463 header[hlen] = ((u16_t)b2 << 8) + b1;
466 header[hlen+1] = ((u16_t)b2 << 8) + b1;
467 header[hlen+2] = (u16_t) iv32;
468 header[hlen+3] = (u16_t) (iv32 >> 16);
482 header[4] |= 0x4000;
501 header[hlen] = ((u16_t)b2 << 8) + b1;
502 header[hlen+1] = 0x2000;
503 header[hlen+2] = (u16_t) (iv32);
504 header[hlen+3] = (u16_t) (iv32 >> 16);
509 header[4] |= 0x4000;
548 header[hlen] = (keyIdx & 0x0001); /* For Key Id and reserved field */
549 header[hlen+1] = (u16_t)txiv[0];
550 header[hlen+2] = (u16_t)(txiv[0] >> 16);
551 header[hlen+3] = (u16_t)txiv[1];
552 header[hlen+4] = (u16_t)(txiv[1] >> 16);
553 header[hlen+5] = (u16_t)txiv[2];
554 header[hlen+6] = (u16_t)(txiv[2] >> 16);
555 header[hlen+7] = (u16_t)txiv[3];
556 header[hlen+8] = (u16_t)(txiv[3] >> 16);
561 header[4] |= 0x4000;
587 header[4] |= 0x4000;
588 header[hlen] = 0x0; //IV
589 header[hlen+1] = wd->ap.bcKeyIndex[vap] << 14; //IV with Keyid--CWYang(m)
615 header[4] |= 0x4000;
616 header[hlen] = 0x0; //IV
617 header[hlen+1] = wd->ap.bcKeyIndex[vap] << 14; //IV with Keyid
633 header[hlen] = ((u16_t)b2 << 8) + b1;
636 header[hlen+1] = ((u16_t)b2 << 8) + b1;
637 header[hlen+2] = (u16_t) wd->sta.iv32;
638 header[hlen+3] = (u16_t) (wd->sta.iv32 >> 16);
652 header[4] |= 0x4000;
665 header[hlen] = ((u16_t)b2 << 8) + b1;
666 header[hlen+1] = 0x2000;
667 header[hlen+2] = (u16_t) (wd->sta.iv32);
668 header[hlen+3] = (u16_t) (wd->sta.iv32 >> 16);
673 header[4] |= 0x4000; /* Set WEP bit in wlan header */
689 header[4] |= 0x0080;
692 header[hlen] = up;
706 header[4] |= 0x4000;
707 header[hlen] = 0x0; //IV
708 header[hlen+1] = 0x0; //IV
709 header[hlen+1] |= (((u16_t) wd->sta.keyId) << 14);
761 header[hlen] = ((u16_t)b2 << 8) + b1;
765 // header[hlen+1] = (((u16_t) wd->sta.keyId) << 14) | (((u16_t)b2 << 8) + b1);
767 header[hlen+1] = (((u16_t)b2 << 8) + b1);
768 header[hlen+2] = (u16_t) wd->sta.iv32;
769 header[hlen+3] = (u16_t) (wd->sta.iv32 >> 16);
820 header[4] |= 0x4000;
827 header[hlen] = ((u16_t)b2 << 8) + b1;
828 // header[hlen+1] = (((u16_t) wd->sta.keyId) << 14) | (0x2000);
830 header[hlen+1] = 0x2000;
831 header[hlen+2] = (u16_t) (wd->sta.iv32);
832 header[hlen+3] = (u16_t) (wd->sta.iv32 >> 16);
837 header[4] |= 0x4000;
868 header[hlen] = (wd->sta.cencKeyId & 0x0001); /* For Key Id and reserved field */
869 header[hlen+1] = (u16_t) wd->sta.txiv[0];
870 header[hlen+2] = (u16_t) (wd->sta.txiv[0] >> 16);
871 header[hlen+3] = (u16_t) wd->sta.txiv[1];
872 header[hlen+4] = (u16_t) (wd->sta.txiv[1] >> 16);
873 header[hlen+5] = (u16_t) wd->sta.txiv[2];
874 header[hlen+6] = (u16_t) (wd->sta.txiv[2] >> 16);
875 header[hlen+7] = (u16_t) wd->sta.txiv[3];
876 header[hlen+8] = (u16_t) (wd->sta.txiv[3] >> 16);
881 header[4] |= 0x4000;
934 header[hlen] = ((u16_t)b2 << 8) + b1;
938 header[hlen+1] = 0x2000;
942 header[hlen+1] = 0x2000 | (((u16_t) wd->sta.keyId) << 14);
945 header[hlen+2] = (u16_t) (*iv32);
946 header[hlen+3] = (u16_t) ((*iv32) >> 16);
951 header[4] |= 0x4000;
960 header[4] |= 0x4000;
961 header[hlen] = 0x0; //IV
962 header[hlen+1] = 0x0; //IV
963 header[hlen+1] |= (((u16_t) wd->sta.keyId) << 14);
991 header[hlen] = ((u16_t)b2 << 8) + b1;
995 header[hlen+1] = 0x2000;
999 header[hlen+1] = 0x2000 | (((u16_t) wd->sta.keyId) << 14);
1002 header[hlen+2] = (u16_t) (wd->sta.iv32);
1003 header[hlen+3] = (u16_t) (wd->sta.iv32 >> 16);
1008 header[4] |= 0x4000;
1017 header[4] |= 0x4000;
1018 header[hlen] = 0x0; //IV
1019 header[hlen+1] = 0x0; //IV
1020 header[hlen+1] |= (((u16_t) wd->sta.keyId) << 14);
1036 header[4] |= 0x4000;
1037 header[hlen] = 0x0; //IV
1038 header[hlen+1] = 0x0; //IV
1054 header[hlen] = ((u16_t)b2 << 8) + b1;
1057 header[hlen+1] = ((u16_t)b2 << 8) + b1;
1058 header[hlen+2] = (u16_t) wd->sta.iv32;
1059 header[hlen+3] = (u16_t) (wd->sta.iv32 >> 16);
1073 header[4] |= 0x4000;
1088 header[hlen] = ((u16_t)b2 << 8) + b1;
1089 header[hlen+1] = 0x2000;
1090 header[hlen+2] = (u16_t) (wd->sta.iv32);
1091 header[hlen+3] = (u16_t) (wd->sta.iv32 >> 16);
1094 header[4] |= 0x4000;
1126 header[hlen] = 0;
1127 header[hlen+1] = (u16_t) wd->sta.txiv[0];
1128 header[hlen+2] = (u16_t) (wd->sta.txiv[0] >> 16);
1129 header[hlen+3] = (u16_t) wd->sta.txiv[1];
1130 header[hlen+4] = (u16_t) (wd->sta.txiv[1] >> 16);
1131 header[hlen+5] = (u16_t) wd->sta.txiv[2];
1132 header[hlen+6] = (u16_t) (wd->sta.txiv[2] >> 16);
1133 header[hlen+7] = (u16_t) wd->sta.txiv[3];
1134 header[hlen+8] = (u16_t) (wd->sta.txiv[3] >> 16);
1139 header[4] |= 0x4000;
1264 //802.11 header(include IV) = (hlen<<1)-8
1267 //ethernet header = minusLen
1270 //length=802.11 header+snap+(ethernet frame-ethernet header)+mic+icv+crc32
1271 header[0] = ((hlen<<1)-8)+plusLen+(len-minusLen)+icvLen+4; //Length
1273 // header[0] : MPDU Lengths
1274 if ((header[6] & 0x1) != 0x1) // Unicast Frame
1276 if (header[0] >= wd->rtsThreshold)
1288 if ( header[0] > ( wd->fragThreshold + tkipFrameOffset ) )
1296 // zm_debug_msg1("ctrl length = ", header[0]);
1304 header[1] = macCtrl;
1306 header[2] = (u16_t) ((phyCtrl&0xffff) | 0x700 | (zcUpToAc[up&0x7]<<13));
1308 header[3] = (u16_t) ((phyCtrl>>16) | 0x700);
1313 if (wd->enableAggregation==2 && !(header[6]&0x1))
1315 if (((header[2] & 0x3) == 2))
1318 header[1] |= 0x20;
1328 if (!(header[6]&0x1) && !rateProbingFlag && (wd->enableAggregation != 1))
1330 if (((header[2] & 0x3) == 2))
1338 header[1] |= (0x20 | (zcUpToAc[up&0x7]<<10));
1346 header[1] &= 0xfffc;
1347 header[1] |= 0x1;
1351 //header[1] |= 0x2000;
1361 if (wd->enableAggregation==0 && !(header[6]&0x1))
1363 if (((header[2] & 0x3) == 2))
1366 header[1] |= 0x20;
1368 header[1] |= 0x4000;
1371 zm_debug_msg1("no aggr, header[2]&0x3 = ",header[2] & 0x3)
1377 zm_debug_msg1("no aggr, !header[6]&0x1 = ",!(header[6]&0x1));
1384 if (!(header[6]&0x1) && !rateProbingFlag)
1386 if (((header[2] & 0x3) == 2))
1390 header[1] |= (0x20 | (zcUpToAc[up&0x7]<<10));
1395 header[1] &= 0xfffc;
1396 header[1] |= 0x1;
1409 u16_t* header, u16_t len, zbuf_t* buf, u16_t vap, u8_t encrypt)
1412 u8_t hlen = 32; // MAC ctrl + PHY ctrl + 802.11 MM header
1420 header[0] = 24+len+4; //Length
1423 header[1] = 0xc; //MAC control, backoff + noack
1427 header[1] = 0x8; //MAC control, backoff + (ack)
1435 header[2] = 0x0f00; //PHY control L
1436 header[3] = 0x0000; //PHY control H
1441 header[2] = 0x0f01; //PHY control L
1442 header[3] = 0x000B; //PHY control H
1450 header[2] = 0x0f00; //PHY control L
1451 header[3] = 0x0001; //PHY control H
1456 header[2] = 0x0f01; //PHY control L
1457 header[3] = 0x000B; //PHY control H
1460 /* Generate WLAN header */
1462 header[4+0] = frameType;
1464 header[4+1] = 0;
1470 header[4+8] = 0xFFFF;
1471 header[4+9] = 0xFFFF;
1472 header[4+10] = 0xFFFF;
1479 header[4+8] = wd->sta.bssid[0];
1480 header[4+9] = wd->sta.bssid[1];
1481 header[4+10] = wd->sta.bssid[2];
1487 header[4+8] = 0;
1488 header[4+9] = 0;
1489 header[4+10] = 0;
1493 header[4+8] = wd->sta.bssid[0];
1494 header[4+9] = wd->sta.bssid[1];
1495 header[4+10] = wd->sta.bssid[2];
1500 //header[2] |= (ZM_BIT_13|ZM_BIT_14);
1501 header[2] |= ZM_BIT_15;
1507 header[4+8] = wd->macAddr[0];
1508 header[4+9] = wd->macAddr[1];
1510 header[4+10] = wd->macAddr[2]; //Multiple SSID
1512 header[4+10] = wd->macAddr[2] + (vap<<8); //VAP
1520 header[4+8] = 0xFFFF;
1521 header[4+9] = 0xFFFF;
1522 header[4+10] = 0xFFFF;
1527 header[4+2] = dst[0];
1528 header[4+3] = dst[1];
1529 header[4+4] = dst[2];
1532 header[4+5] = wd->macAddr[0];
1533 header[4+6] = wd->macAddr[1];
1537 header[4+7] = wd->macAddr[2]; //Multiple SSID
1539 header[4+7] = wd->macAddr[2] + (vap<<8); //VAP
1544 header[4+7] = wd->macAddr[2];
1549 header[4+11] = ((wd->mmseq++)<<4);
1555 header[4+12] = 0x0;
1557 header[0]+=2;
1568 header[4] |= 0x4000;
1569 header[16] = 0x0; //IV
1570 header[17] = 0x0; //IV
1571 header[17] |= (((u16_t) wd->sta.keyId) << 14);
1574 header[0] += 8; // icvLen = 4;
1575 header[1] |= 0x40; // enable encryption on macCtrl
1583 header[1] |= 0x200;