17 #include <linux/version.h>
18 #include <linux/types.h>
28 #ifdef CSR_SUPPORT_SME
35 if (priv ==
NULL || bulkdata ==
NULL || buffered_pkt ==
NULL){
62 u8 ba_session_idx = 0;
69 "In unifi_frame_ma_packet_req, Frame for Peer: %pMF\n",
93 if (hostTag == 0xffffffff) {
97 interfacePriv->
tag &= 0x0fffffff;
105 ba_addr = peerMacAddress;
107 ba_addr = interfacePriv->
bssid.
a;
122 #ifdef CSR_SUPPORT_SME
124 #define TRANSMISSION_CONTROL_TRIGGER_MASK 0x0001
125 #define TRANSMISSION_CONTROL_EOSP_MASK 0x0002
139 unifi_trace(priv,
UDBG3,
"frame_and_send_queued_pdu with moreData: %d , EOSP: %d\n",moreData,eosp);
170 if (fromDs && toDs) {
184 *qc = eosp ? *qc | (1 << 4) : *qc & (~(1 << 4));
188 macHeaderLengthInBytes += 6;
194 _update_buffered_pkt_params_after_alignment(priv, &bulkdata,buffered_pkt);
200 if (!priv->noOfPktQueuedInDriver) {
201 unifi_error(priv,
"packets queued in driver 0 still decrementing\n");
204 priv->noOfPktQueuedInDriver--;
205 spin_unlock_irqrestore(&priv->tx_q_lock,lock_flags);
211 unifi_error(priv,
"packets queued in driver per station is 0 still decrementing\n");
217 if (staRecord->nullDataHostTag == buffered_pkt->
hostTag){
221 spin_unlock_irqrestore(&priv->staRecord_lock,lock_flags);
227 #ifdef CSR_SUPPORT_SME
240 if (list_empty(txList)) {
241 unifi_warning(priv,
"In set_eosp_transmit_ctrl, the list is empty\n");
254 unifi_trace(priv,
UDBG3,
"in set_eosp_transmit_ctrl no.of buffered frames %d\n",priv->noOfPktQueuedInDriver);
257 spin_unlock_irqrestore(&priv->tx_q_lock,lock_flags);
271 unifi_trace(priv,
UDBG3,
"send_vif_availibility_rsp : invoked with resultCode = %d \n", resultCode);
284 unifi_error(priv,
"Availibility response sending failed %x status %d\n",vif,r);
293 void verify_and_accomodate_tx_packet(
unifi_priv_t *priv)
299 u8 i,
j,eospFramedeleted=0;
300 u8 thresholdExcedeDueToBroadcast =
TRUE;
309 staInfo = interfacePriv->staInfo[
i];
310 if (staInfo && (staInfo->
noOfPktQueued >= CSR_WIFI_DRIVER_MAX_PKT_QUEUING_THRESHOLD_PER_PEER)) {
322 thresholdExcedeDueToBroadcast =
FALSE;
326 if (!priv->noOfPktQueuedInDriver) {
330 priv->noOfPktQueuedInDriver--;
337 spin_lock(&priv->staRecord_lock);
339 spin_unlock(&priv->staRecord_lock);
343 spin_unlock_irqrestore(&priv->tx_q_lock,lock_flags);
347 if (thresholdExcedeDueToBroadcast && interfacePriv->noOfbroadcastPktQueued > CSR_WIFI_DRIVER_MINIMUM_BROADCAST_PKT_THRESHOLD ) {
352 list_for_each_safe(listHead, placeHolder, &interfacePriv->genericMulticastOrBroadCastFrames) {
354 if(eospFramedeleted){
363 eospFramedeleted = 1;
369 priv->noOfPktQueuedInDriver--;
370 spin_lock(&priv->staRecord_lock);
371 interfacePriv->noOfbroadcastPktQueued--;
372 spin_unlock(&priv->staRecord_lock);
373 if(!eospFramedeleted){
377 spin_unlock_irqrestore(&priv->tx_q_lock,lock_flags);
400 if (priv->noOfPktQueuedInDriver >= CSR_WIFI_DRIVER_SUPPORT_FOR_MAX_PKT_QUEUEING) {
401 unifi_trace(priv,
UDBG3,
"number of pkts queued= %d \n", priv->noOfPktQueuedInDriver);
402 verify_and_accomodate_tx_packet(priv);
408 if (tx_q_item ==
NULL) {
410 "Failed to allocate %d bytes for tx packet record\n",
418 INIT_LIST_HEAD(&tx_q_item->
q);
434 if (requeueOnSamePos) {
435 list_add(&tx_q_item->
q, list);
441 priv->noOfPktQueuedInDriver++;
442 spin_unlock_irqrestore(&priv->tx_q_lock,lock_flags);
447 #ifdef CSR_WIFI_REQUEUE_PACKET_TO_HAL
448 CsrResult unifi_reque_ma_packet_request (
void *ospriv,
u32 host_tag,
459 u16 interfaceTag = 0;
461 u16 frameControl = 0, frameType = 0;
474 unifi_trace(priv,
UDBG6,
"unifi_reque_ma_packet_request: host_tag = 0x%x\n", host_tag);
476 staRecord = CsrWifiRouterCtrlGetStationRecordFromPeerMacAddress(priv,
479 if (
NULL == staRecord) {
480 unifi_trace(priv,
UDBG5,
"unifi_reque_ma_packet_request: Invalid STA record \n");
490 unifi_trace(priv,
UDBG2,
"unifi_reque_ma_packet_request: CFM failed with Retry Limit or No BSS-->update TIM\n");
499 unifi_trace(priv,
UDBG6,
"unifi_reque_ma_packet_request: One more UpdateTim Request(:%d)Queued for AID %x\n",
532 u8 dataFrameType = 0;
550 if (priority < CSR_QOS_UP0 || priority >
CSR_QOS_UP7) {
551 unifi_trace(priv,
UDBG5,
"unifi_reque_ma_packet_request: Invalid priority:%x \n", priority);
580 list = &staRecord->
dataPdu[priority_q];
583 status = enque_tx_data_pdu(priv, &bulkData, list, &signal,
TRUE);
589 spin_unlock_irqrestore(&priv->staRecord_lock, lock_flags);
606 *allDeliveryEnabled =
TRUE;
610 *allDeliveryEnabled =
FALSE;
614 if (*allDeliveryEnabled) {
615 *dataAvailable = (!list_empty(&staRecord->
dataPdu[0]) || !list_empty(&staRecord->
dataPdu[1])
616 ||!list_empty(&staRecord->
dataPdu[2]) ||!list_empty(&staRecord->
dataPdu[3])
645 static u8 retryCount = 0;
650 unifi_warning(priv,
"bad interfaceTag = %x\n", interfaceTag);
662 spin_unlock_irqrestore(&priv->staRecord_lock,lock_flags);
663 unifi_warning(priv,
"uf_handle_tim_cfm: station record is NULL handle = %x\n", handle);
666 spin_unlock_irqrestore(&priv->staRecord_lock,lock_flags);
677 unifi_warning(priv,
"timSet state is %x: Debug\n", timSetStatus);
687 if (timSetStatus == staRecord->
timSet) {
688 staRecord->
timSet = timSetValue;
693 unifi_trace(priv,
UDBG2,
"tim (%s) successfully in firmware\n", (timSetValue)?
"SET":
"RESET");
695 unifi_trace(priv,
UDBG3,
"receiver processID = %x, success: request & confirm states are not matching in TIM cfm: Debug status = %x, staRecord->timSet = %x, handle = %x\n",
696 receiverProcessId, timSetStatus, staRecord->
timSet, handle);
710 unifi_trace(priv,
UDBG2,
"uf_handle_tim_cfm : Processing Queued UpdateTimReq \n");
719 interfacePriv->
bcTimSet = timSetValue;
724 unifi_trace(priv,
UDBG3,
"tim (%s) successfully for broadcast frame in firmware\n", (timSetValue)?
"SET":
"RESET");
737 unifi_trace(priv,
UDBG2,
"uf_handle_tim_cfm : Processing Queued UpdateDTimReq \n");
774 u8 allDeliveryEnabled = 0, dataAvailable = 0;
776 is_all_ac_deliver_enabled_and_moredata(staRecord, &allDeliveryEnabled, &dataAvailable);
778 moreData = (uf_is_more_data_for_non_delivery_ac(staRecord) || (allDeliveryEnabled && dataAvailable));
792 moreData = (!list_empty(&interfacePriv->genericMulticastOrBroadCastMgtFrames) ||
793 !list_empty(&interfacePriv->genericMulticastOrBroadCastFrames));
801 unifi_error(priv,
"no of error's for TIM setting crossed the Limit: verify\n");
807 if (timSetStatus == staRecord->
timSet) {
808 unifi_warning(priv,
"tim request failed, retry for AID = %x\n", staRecord->
aid);
809 update_tim(priv, staRecord->
aid, timSetValue, interfaceTag, handle);
811 unifi_trace(priv,
UDBG1,
"failure: request & confirm states are not matching in TIM cfm: Debug status = %x, staRecord->timSet = %x\n",
812 timSetStatus, staRecord->
timSet);
815 unifi_warning(priv,
"tim request failed, retry for broadcast frames\n");
816 update_tim(priv, 0, timSetValue, interfaceTag, 0xFFFFFFFF);
868 u32 oldTimSetStatus = 0, timSetStatus = 0;
873 if (handle == 0xFFFFFFFF) {
875 if (setTim == interfacePriv->
bcTimSet)
877 unifi_trace(priv,
UDBG3,
"update_tim, Drop:Hdl=%x, timval=%d, globalTim=%d\n", handle, setTim, interfacePriv->
bcTimSet);
880 }
else if ((handle != 0xFFFFFFFF) && (handle >= UNIFI_MAX_CONNECTIONS)) {
893 unifi_warning(priv,
"station record is NULL in update_tim: handle = %x :debug\n", handle);
897 oldTimSetStatus = staRecord->
timSet;
898 staRecord->
timSet = timSetStatus;
919 unifi_trace(priv,
UDBG2,
"update_tim:AID %x,senderIdLsb = 0x%x, handle = 0x%x, timSetStatus = %x, sender proceesID = %x \n",
926 unifi_error(priv,
"Error queueing CSR_MLME_SET_TIM_REQUEST signal\n");
928 staRecord->
timSet = oldTimSetStatus ;
954 void process_peer_active_transition(
unifi_priv_t * priv,
968 unifi_trace(priv,
UDBG2,
"Multicast transmission is going on so resume unicast transmission after DTIM over\n");
989 while((buffered_pkt=dequeue_tx_data_pdu(priv, &staRecord->
mgtFrames))) {
991 ~(TRANSMISSION_CONTROL_TRIGGER_MASK|TRANSMISSION_CONTROL_EOSP_MASK);
992 if((r=frame_and_send_queued_pdu(priv,buffered_pkt,staRecord,0,
FALSE)) == -
ENOSPC) {
996 list_add(&buffered_pkt->
q, &staRecord->
mgtFrames);
997 spin_unlock_irqrestore(&priv->tx_q_lock,lock_flags);
999 spaceAvail[3] =
FALSE;
1003 unifi_trace (priv,
UDBG1,
" HIP validation failure : PDU sending failed \n");
1007 kfree(buffered_pkt);
1031 while((buffered_pkt=dequeue_tx_data_pdu(priv, &staRecord->
dataPdu[i]))) {
1033 ~(TRANSMISSION_CONTROL_TRIGGER_MASK|TRANSMISSION_CONTROL_EOSP_MASK);
1034 if((r=frame_and_send_queued_pdu(priv,buffered_pkt,staRecord,0,
FALSE)) == -
ENOSPC) {
1038 list_add(&buffered_pkt->
q, &staRecord->
dataPdu[i]);
1039 spin_unlock_irqrestore(&priv->tx_q_lock,lock_flags);
1044 unifi_trace (priv,
UDBG1,
" HIP validation failure : PDU sending failed \n");
1048 kfree(buffered_pkt);
1083 resume_suspended_uapsd(priv,interfaceTag);
1084 resume_unicast_buffered_frames(priv,interfaceTag);
1085 if(list_empty(&interfacePriv->genericMulticastOrBroadCastMgtFrames) &&
1086 list_empty(&interfacePriv->genericMulticastOrBroadCastFrames)) {
1098 unifi_trace(priv,
UDBG2,
"uf_process_ma_pkt_cfm_for_ap : One more UpdateDTim Request(%d) Queued \n",
1111 if (staRecord && (staRecord->nullDataHostTag == pkt_cfm->
HostTag)) {
1113 unifi_trace(priv,
UDBG1,
"CFM for Inactive probe Null frame (tag = %x, status = %d)\n",
1123 unifi_trace(priv,
UDBG1,
"Nulldata to probe STA ALIVE Failed with retry limit\n");
1129 if (staRecord->activity_flag){
1134 if (staRecord->lastActivity > now)
1156 INIT_LIST_HEAD(&send_cfm_list);
1158 uf_prepare_send_cfm_list_for_queued_pkts(priv,
1162 uf_flush_list(priv, &(staRecord->
mgtFrames));
1165 uf_prepare_send_cfm_list_for_queued_pkts(priv,
1169 uf_flush_list(priv,&(staRecord->
dataPdu[j]));
1176 unifi_warning(priv,
"uf_process_ma_pkt_cfm_for_ap: Router Disconnected IND Peer (%x-%x-%x-%x-%x-%x)\n",
1186 staRecord->interfacePriv->InterfaceTag,
1194 staRecord->activity_flag =
TRUE;
1207 return (0x02<<8|tag);
1211 return (0x03<<8|tag);
1214 return (0x01<<8|tag);
1217 return (0x04<<8|tag);
1219 return (0x05<<8|tag);
1225 #ifdef CSR_SUPPORT_SME
1256 u8 macHeaderLengthInBytes,
1271 memcpy(macHeaderBuf, skb->
data, macHeaderLengthInBytes);
1274 skb_pull(skb, macHeaderLengthInBytes);
1277 headroom = skb_headroom(skb);
1280 fc = (
u16*) macHeaderBuf;
1284 unifi_trace(priv,
UDBG5,
"In update_macheader function, fromDs = %x, toDs = %x\n", fromDs, toDs);
1285 direction = ((fromDs | (toDs << 1)) & 0x3);
1311 unifi_trace(priv,
UDBG3,
"when both the toDs & fromDS set, NOT SUPPORTED\n");
1314 unifi_trace(priv,
UDBG3,
"problem in decoding packet in update_macheader \n");
1321 switch(
le16_to_cpu(*fc) & IEEE80211_FC_SUBTYPE_MASK)
1325 if (!qosDestination) {
1334 macHeaderLengthInBytes -= 6;
1336 macHeaderLengthInBytes -= 2;
1344 if (headroom < macHeaderLengthInBytes) {
1345 unifi_trace(priv,
UDBG1,
" sufficient headroom not there to push updated mac header \n");
1348 bufPtr = (
u8 *)
skb_push(skb, macHeaderLengthInBytes);
1359 qc = *((
u8*)(macHeaderBuf + (macHeaderLengthInBytes - 4 - 2)));
1361 qc = *((
u8*)(macHeaderBuf + (macHeaderLengthInBytes - 2)));
1364 if ((qc & IEEE802_11_QC_TID_MASK) > 7) {
1370 unifi_trace(priv,
UDBG1,
"Incoming packet priority from QSTA is %x\n", *priority);
1372 if (headroom < macHeaderLengthInBytes) {
1373 unifi_trace(priv,
UDBG3,
" sufficient headroom not there to push updated mac header \n");
1376 bufPtr = (
u8 *)
skb_push(skb, macHeaderLengthInBytes);
1385 if (qosDestination) {
1401 macHeaderLengthInBytes += 2;
1408 macHeaderBuf[macHeaderLengthInBytes - 2] = qc;
1410 macHeaderBuf[macHeaderLengthInBytes - 1] = 0;
1411 if (headroom < macHeaderLengthInBytes) {
1415 unifi_error(priv,
" failed to allocate request_data. in update_macheader func\n");
1419 newSkb->
len = skb->
len + macHeaderLengthInBytes;
1434 bufPtr = (
u8*)
skb_push(skb, macHeaderLengthInBytes);
1441 if (headroom < macHeaderLengthInBytes) {
1445 unifi_error(priv,
" failed to allocate request_data. in update_macheader func\n");
1449 newSkb->
len = skb->
len + macHeaderLengthInBytes;
1464 bufPtr = (
u8*)
skb_push(skb, macHeaderLengthInBytes);
1474 unifi_trace(priv,
UDBG5,
"updated Mac Header: %d \n",macHeaderLengthInBytes);
1475 memcpy(bufPtr, macHeaderBuf, macHeaderLengthInBytes);
1507 u8 macHeaderLengthInBytes)
1520 unifi_trace(priv,
UDBG5,
"entering uf_ap_process_data_pdu %d\n",macHeaderLengthInBytes);
1523 unifi_trace(priv,
UDBG1,
"Interface Tag is Invalid in uf_ap_process_data_pdu\n");
1535 dstStaInfo = CsrWifiRouterCtrlGetStationRecordFromPeerMacAddress(priv, ehdr->
h_dest, interfaceTag);
1552 dstStaInfo = CsrWifiRouterCtrlGetStationRecordFromPeerMacAddress(priv, ehdr->
h_dest, interfaceTag);
1556 if (!(ehdr->
h_dest[0] & 0x1)) {
1565 if(skbPtr ==
NULL) {
1570 sendToNetdev =
TRUE;
1575 if (uf_process_station_records_for_sending_data(priv, interfaceTag, srcStaInfo, dstStaInfo)) {
1576 unifi_notice(priv,
"uf_ap_process_data_pdu: station record validation failed \n");
1577 interfacePriv->
stats.rx_errors++;
1589 qosDestination =
FALSE;
1591 qosDestination =
TRUE;
1594 unifi_trace(priv,
UDBG3,
"uf_ap_process_data_pdu QoS destination = %s\n", (qosDestination)?
"TRUE":
"FALSE");
1597 if (update_macheader(priv, skbPtr, newSkb, &priority, bulkdata, interfaceTag, macHeaderLengthInBytes, qosDestination)) {
1598 interfacePriv->
stats.rx_errors++;
1599 unifi_notice(priv,
"(Packet Drop) failed to update the Mac header in uf_ap_process_data_pdu\n");
1610 unifi_trace(priv,
UDBG3,
"Mac Header updated...calling uf_process_ma_packet_req \n");
1615 unifi_trace(priv,
UDBG1,
"In uf_ap_process_data_pdu, (Packet Drop) uf_process_ma_packet_req failed. freeing skb_copy data (original data sent to Netdev)\n");
1623 unifi_trace(priv,
UDBG1,
"In uf_ap_process_data_pdu, (Packet Drop). Unicast data so freeing original skb \n");
1655 #ifdef CSR_SUPPORT_SME
1667 u32 handle = 0xFFFFFFFF;
1671 "entering uf_process_ma_packet_req, peer: %pMF\n",
1675 unifi_error(priv,
"interfaceTag >= CSR_WIFI_NUM_INTERFACES, interfacetag = %d\n", interfaceTag);
1682 if ((staRecord = CsrWifiRouterCtrlGetStationRecordFromPeerMacAddress(priv, peerMacAddress, interfaceTag))) {
1688 interfaceTag, transmissionControl, leSenderProcessId,
1689 peerMacAddress, &signal);
1724 queuePacketDozing =
TRUE;
1728 if (*peerMacAddress & 0x1) {
1749 unifi_trace(priv,
UDBG5,
"management unicast PDU in uf_process_ma_packet_req \n");
1753 if (list_empty(&interfacePriv->genericMgtFrames)) {
1754 #ifdef CSR_SUPPORT_SME
1758 unifi_trace(priv,
UDBG3,
"genericMgtFrames list is empty uf_process_ma_packet_req \n");
1763 unifi_trace(priv,
UDBG1,
"(ENOSPC) Sending genericMgtFrames Failed so buffering\n");
1764 list = &interfacePriv->genericMgtFrames;
1765 requeueOnSamePos =
TRUE;
1767 #ifdef CSR_SUPPORT_SME
1769 list = &interfacePriv->genericMgtFrames;
1771 update_eosp_to_head_of_broadcast_list_head(priv,interfaceTag);
1776 list = &interfacePriv->genericMgtFrames;
1786 unifi_trace(priv,
UDBG1,
"staRecord->MgtFrames list empty? = %s, handle = %d, queuePacketDozing = %d\n",
1789 update_eosp_to_head_of_broadcast_list_head(priv,interfaceTag);
1793 unifi_trace(priv,
UDBG5,
"staRecord->mgtFrames list is empty uf_process_ma_packet_req \n");
1798 requeueOnSamePos =
TRUE;
1801 }
else if (result) {
1808 unifi_trace(priv,
UDBG5,
"management multicast/broadcast PDU in uf_process_ma_packet_req 'QUEUE it' \n");
1813 list = &interfacePriv->genericMulticastOrBroadCastMgtFrames;
1815 (list_empty(&interfacePriv->genericMulticastOrBroadCastMgtFrames))) {
1820 unifi_error(priv,
"condition never meets: packet type unrecognized\n");
1827 unifi_trace(priv,
UDBG5,
"data unicast PDU in uf_process_ma_packet_req \n");
1835 unifi_trace(priv,
UDBG2,
"Enqueued to staRecord->dataPdu[%d] queuePacketDozing=%d,\
1836 Buffering enabled = %d \n", priority_q,queuePacketDozing,isRouterBufferEnabled(priv,priority_q));
1837 list = &staRecord->
dataPdu[priority_q];
1839 unifi_trace(priv,
UDBG5,
"staRecord->dataPdu[%d] list is empty uf_process_ma_packet_req \n", priority_q);
1844 unifi_trace(priv,
UDBG1,
"(ENOSPC) Sending Unicast DataPDU to queue %d Failed so buffering\n",priority_q);
1845 requeueOnSamePos =
TRUE;
1846 list = &staRecord->
dataPdu[priority_q];
1848 if(!isRouterBufferEnabled(priv,priority_q)) {
1849 unifi_error(priv,
"Buffering Not enabled for queue %d \n",priority_q);
1851 }
else if (result) {
1857 unifi_trace(priv,
UDBG5,
"data multicast/broadcast PDU in uf_process_ma_packet_req \n");
1861 list = &interfacePriv->genericMulticastOrBroadCastFrames;
1862 if(list_empty(&interfacePriv->genericMulticastOrBroadCastFrames)) {
1867 unifi_error(priv,
"condition never meets: packet type un recognized\n");
1874 status = enque_tx_data_pdu(priv, bulkdata,list, &signal,requeueOnSamePos);
1879 spin_unlock_irqrestore(&priv->staRecord_lock,lock_flags);
1885 interfacePriv->noOfbroadcastPktQueued++;
1886 spin_unlock_irqrestore(&priv->staRecord_lock,lock_flags);
1890 if(setBcTim && !status) {
1902 unifi_trace(priv,
UDBG2,
"uf_process_ma_packet_req : One more UpdateDTim Request(:%d) Queued \n",
1909 if(!list_empty(&staRecord->
mgtFrames) ||
1910 !list_empty(&staRecord->
dataPdu[3]) ||
1912 unifi_trace(priv,
UDBG3,
"tim set due to unicast pkt & peer in powersave\n");
1928 u8 allDeliveryEnabled = 0, dataAvailable = 0;
1930 is_all_ac_deliver_enabled_and_moredata(staRecord, &allDeliveryEnabled, &dataAvailable);
1931 if (uf_is_more_data_for_non_delivery_ac(staRecord) || (allDeliveryEnabled && dataAvailable)
1932 || (!list_empty(&staRecord->
mgtFrames))) {
1951 unifi_trace(priv,
UDBG2,
"buffering cleared for queue = %d So resending buffered frames\n",priority_q);
1952 uf_send_buffered_frames(priv, priority_q);
1957 #ifdef CSR_NATIVE_LINUX
1959 unifi_error(priv,
"interfaceTag >= CSR_WIFI_NUM_INTERFACES, interfacetag = %d\n", interfaceTag);
1964 transmissionControl, leSenderProcessId,
1965 peerMacAddress, &signal);
1975 #ifdef CSR_SUPPORT_SME
1987 protection = interfacePriv->
protect;
1993 if (daddr[0] & 0x1) {
1994 unifi_trace(priv,
UDBG3,
"broadcast/multicast packet in send_ma_pkt_request\n");
1998 protection = interfacePriv->
protect;
2001 dstStaInfo = CsrWifiRouterCtrlGetStationRecordFromPeerMacAddress(priv, daddr, interfaceTag);
2003 unifi_trace(priv,
UDBG3,
"peer not found in station record in send_ma_pkt_request\n");
2016 #ifdef CSR_SUPPORT_SME
2025 u32 hostTag = 0xffffffff;
2029 while((interfacePriv->
dtimActive)&& (buffered_pkt=dequeue_tx_data_pdu(priv,&interfacePriv->genericMulticastOrBroadCastMgtFrames))) {
2034 unifi_trace(priv,
UDBG2,
"DTIM Occurred for interface:sending Mgt packet %d\n",interfaceTag);
2036 if((r=frame_and_send_queued_pdu(priv,buffered_pkt,
NULL,moreData,
FALSE)) == -
ENOSPC) {
2037 unifi_trace(priv,
UDBG1,
"frame_and_send_queued_pdu failed with ENOSPC for host tag = %x\n", buffered_pkt->
hostTag);
2040 list_add(&buffered_pkt->
q, &interfacePriv->genericMulticastOrBroadCastMgtFrames);
2041 spin_unlock_irqrestore(&priv->tx_q_lock,lock_flags);
2044 unifi_trace(priv,
UDBG1,
"send_multicast_frames: Send genericMulticastOrBroadCastMgtFrames (%x, %x)\n",
2054 hostTag = buffered_pkt->
hostTag;
2062 interfacePriv->noOfbroadcastPktQueued--;
2063 spin_unlock_irqrestore(&priv->staRecord_lock,lock_flags);
2064 kfree(buffered_pkt);
2070 while((interfacePriv->
dtimActive)&& (buffered_pkt=dequeue_tx_data_pdu(priv,&interfacePriv->genericMulticastOrBroadCastFrames))) {
2075 if((r=frame_and_send_queued_pdu(priv,buffered_pkt,
NULL,moreData,
FALSE)) == -
ENOSPC) {
2080 list_add(&buffered_pkt->
q, &interfacePriv->genericMulticastOrBroadCastFrames);
2081 spin_unlock_irqrestore(&priv->tx_q_lock,lock_flags);
2085 unifi_trace(priv,
UDBG1,
"send_multicast_frames: Send genericMulticastOrBroadCastFrame failed (%x, %x)\n",
2094 hostTag = buffered_pkt->
hostTag;
2101 interfacePriv->noOfbroadcastPktQueued--;
2102 spin_unlock_irqrestore(&priv->staRecord_lock,lock_flags);
2103 kfree(buffered_pkt);
2109 unifi_trace(priv,
UDBG2,
"send_multicast_frames: Recorded hostTag of EOSP packet: = 0x%x\n",hostTag);
2118 #ifdef CSR_SUPPORT_SME
2129 "uf_process_ma_vif_availibility_ind: Process signal 0x%.4X\n",
2135 "uf_process_ma_vif_availibility_ind: Received unknown signal 0x%.4X.\n",
2144 unifi_error(priv,
"in vif_availability_ind interfaceTag is wrong\n");
2151 if(list_empty(&interfacePriv->genericMulticastOrBroadCastFrames) &&
2152 list_empty(&interfacePriv->genericMulticastOrBroadCastMgtFrames)) {
2156 unifi_notice(priv,
"ma_vif_availibility_ind recevied for multicast but queues are empty%d\n",interfaceTag);
2160 unifi_notice(priv,
"ma_vif_availibility_ind recevied for multicast but queues are empty%d\n",interfaceTag);
2172 unifi_trace(priv,
UDBG2,
"uf_process_ma_vif_availibility_ind : One more UpdateDTim Request(%d) Queued \n",
2179 unifi_trace(priv,
UDBG2,
"DTIM Occurred for already active DTIM interface %d\n",interfaceTag);
2183 if(list_empty(&interfacePriv->genericMulticastOrBroadCastFrames)) {
2184 set_eosp_transmit_ctrl(priv,&interfacePriv->genericMulticastOrBroadCastMgtFrames);
2186 set_eosp_transmit_ctrl(priv,&interfacePriv->genericMulticastOrBroadCastFrames);
2190 pduSent = send_multicast_frames(priv,interfaceTag);
2193 unifi_error(priv,
"Interface switching is not supported %d\n",interfaceTag);
2199 #ifdef CSR_SUPPORT_SME
2201 #define GET_ACTIVE_INTERFACE_TAG(priv) 0
2211 &&(!list_empty(&staRecord->
dataPdu[i]))) {
2212 unifi_trace(priv,
UDBG2,
"uf_is_more_data_for_delivery_ac: Data Available AC = %d\n", i);
2217 unifi_trace(priv,
UDBG2,
"uf_is_more_data_for_delivery_ac: Data NOT Available \n");
2229 &&(!list_empty(&staRecord->
dataPdu[i]))) {
2230 unifi_trace(priv,
UDBG2,
"uf_is_more_data_for_usp_delivery: Data Available AC = %d\n", i);
2235 unifi_trace(priv,
UDBG2,
"uf_is_more_data_for_usp_delivery: Data NOT Available \n");
2259 void uf_send_buffered_data_from_delivery_ac(
unifi_priv_t *priv,
2265 u16 interfaceTag = GET_ACTIVE_INTERFACE_TAG(priv);
2279 while((buffered_pkt=dequeue_tx_data_pdu(priv, txList))) {
2281 unifi_trace(priv,
UDBG2,
"uf_send_buffered_data_from_delivery_ac: DTIM Active, suspend UAPSD, staId: 0x%x\n",
2286 staInfo->uspSuspend =
TRUE;
2287 spin_unlock_irqrestore(&priv->staRecord_lock,lock_flags);
2290 list_add(&buffered_pkt->
q,txList);
2291 spin_unlock_irqrestore(&priv->tx_q_lock,lock_flags);
2296 ~(TRANSMISSION_CONTROL_TRIGGER_MASK | TRANSMISSION_CONTROL_EOSP_MASK);
2307 moreData = (!list_empty(txList) || uf_is_more_data_for_usp_delivery(priv, staInfo, queue));
2313 if(moreData ==
FALSE) {
2316 (TRANSMISSION_CONTROL_TRIGGER_MASK | TRANSMISSION_CONTROL_EOSP_MASK);
2320 unifi_warning(priv,
"uf_send_buffered_data_from_delivery_ac: non U-APSD !!! \n");
2323 unifi_trace(priv,
UDBG2,
"uf_send_buffered_data_from_delivery_ac : MoreData:%d, EOSP:%d\n",moreData,eosp);
2325 if((r=frame_and_send_queued_pdu(priv,buffered_pkt,staInfo,moreData,eosp)) == -
ENOSPC) {
2327 unifi_trace(priv,
UDBG2,
"uf_send_buffered_data_from_delivery_ac: UASPD suspended, ENOSPC in hipQ=%x\n", queue);
2331 staInfo->uspSuspend =
TRUE;
2332 spin_unlock_irqrestore(&priv->staRecord_lock,lock_flags);
2335 list_add(&buffered_pkt->
q,txList);
2336 spin_unlock_irqrestore(&priv->tx_q_lock,lock_flags);
2344 kfree(buffered_pkt);
2348 unifi_trace(priv,
UDBG2,
"uf_send_buffered_data_from_delivery_ac: Terminating USP\n");
2350 staInfo->uspSuspend =
FALSE;
2352 spin_unlock_irqrestore(&priv->staRecord_lock,lock_flags);
2355 spin_unlock_irqrestore(&priv->staRecord_lock,lock_flags);
2376 while(!isRouterBufferEnabled(priv,queue) &&
2377 ((buffered_pkt=dequeue_tx_data_pdu(priv, txList))!=
NULL)){
2380 ~(TRANSMISSION_CONTROL_TRIGGER_MASK|TRANSMISSION_CONTROL_EOSP_MASK);
2382 unifi_trace(priv,
UDBG3,
"uf_send_buffered_data_from_ac : MoreData:%d, EOSP:%d\n",moreData,eosp);
2384 if((r=frame_and_send_queued_pdu(priv,buffered_pkt,staInfo,moreData,eosp)) == -
ENOSPC) {
2387 list_add(&buffered_pkt->
q,txList);
2388 spin_unlock_irqrestore(&priv->tx_q_lock,lock_flags);
2389 if(staInfo !=
NULL){
2392 unifi_trace(priv,
UDBG3,
" uf_send_buffered_data_from_ac: PDU sending failed .. no space for queue %d \n",queue);
2398 kfree(buffered_pkt);
2408 u16 interfaceTag = GET_ACTIVE_INTERFACE_TAG(priv);
2409 u32 startIndex=0,endIndex=0;
2425 send_multicast_frames(priv,interfaceTag);
2427 moreData = (!list_empty(&interfacePriv->genericMulticastOrBroadCastMgtFrames) ||
2428 !list_empty(&interfacePriv->genericMulticastOrBroadCastFrames));
2440 unifi_trace(priv,
UDBG2,
"uf_send_buffered_frames : One more UpdateDTim Request(%d) Queued \n",
2445 moreData = (!list_empty(&interfacePriv->genericMulticastOrBroadCastMgtFrames) ||
2446 !list_empty(&interfacePriv->genericMulticastOrBroadCastFrames));
2449 unifi_error(priv,
"ERROR: No More Data but DTIM is active sending Response\n");
2457 if(priv->pausedStaHandle[queue] > 7) {
2458 priv->pausedStaHandle[queue] = 0;
2464 unifi_trace(priv,
UDBG2,
"uf_send_buffered_frames : trying mgt from queue=%d\n",queue);
2466 staInfo = CsrWifiRouterCtrlGetStationRecordFromHandle(priv,startIndex,interfaceTag);
2482 if(isRouterBufferEnabled(priv,queue)) {
2483 unifi_notice(priv,
"uf_send_buffered_frames : No space Left for queue = %d\n",queue);
2488 if(!list_empty(&interfacePriv->genericMgtFrames)) {
2489 unifi_trace(priv,
UDBG2,
"uf_send_buffered_frames : trying generic mgt from queue=%d\n",queue);
2490 uf_send_buffered_data_from_ac(priv,staInfo,
UNIFI_TRAFFIC_Q_VO, &interfacePriv->genericMgtFrames);
2495 unifi_trace(priv,
UDBG2,
"uf_send_buffered_frames : Resume called for Queue=%d\n",queue);
2496 unifi_trace(priv,
UDBG2,
"uf_send_buffered_frames : start=%d end=%d\n",startIndex,endIndex);
2498 startIndex = priv->pausedStaHandle[queue];
2499 endIndex = (startIndex + UNIFI_MAX_CONNECTIONS -1) % UNIFI_MAX_CONNECTIONS;
2501 while(startIndex != endIndex) {
2502 staInfo = CsrWifiRouterCtrlGetStationRecordFromHandle(priv,startIndex,interfaceTag);
2505 if(startIndex >= UNIFI_MAX_CONNECTIONS) {
2512 if(startIndex >= UNIFI_MAX_CONNECTIONS) {
2518 unifi_trace(priv,
UDBG2,
"uf_send_buffered_frames : trying data from queue=%d\n",queue);
2523 if(!list_empty(&staInfo->
dataPdu[queue])) {
2526 uf_send_buffered_data_from_ac(priv, staInfo, queue, (&staInfo->
dataPdu[queue]));
2530 if(startIndex >= UNIFI_MAX_CONNECTIONS) {
2534 if(isRouterBufferEnabled(priv,queue)) {
2535 priv->pausedStaHandle[queue] = endIndex;
2537 priv->pausedStaHandle[queue] = 0;
2543 unifi_trace(priv,
UDBG4,
"csrWifiHipSendBufferedFrames: UAPSD Resume Q=%x\n", queue);
2544 resume_suspended_uapsd(priv, interfaceTag);
2557 &&(!list_empty(&staRecord->
dataPdu[i]))){
2565 &&(!list_empty(&staRecord->
mgtFrames))){
2576 int uf_process_station_records_for_sending_data(
unifi_priv_t *priv,
u16 interfaceTag,
2582 unifi_trace(priv,
UDBG5,
"entering uf_process_station_records_for_sending_data\n");
2585 unifi_error(priv,
"Peer State not connected AID = %x, handle = %x, control port state = %x\n",
2586 srcStaInfo->
aid, srcStaInfo->
assignedHandle, srcStaInfo->peerControlledPort->port_action);
2596 unifi_warning(priv,
"mode is nor AP neither P2PGO, packet cant be xmit\n");
2600 switch(dstStaInfo->peerControlledPort->port_action)
2604 unifi_trace(priv,
UDBG5,
"destination port is closed/blocked, discarding the packet\n");
2613 unifi_trace(priv,
UDBG5,
"leaving uf_process_station_records_for_sending_data\n");
2640 u8 allDeliveryEnabled = 0, dataAvailable = 0;
2644 unifi_trace(priv,
UDBG2,
" ++ uf_handle_uspframes_delivery, uapsd active=%x, suspended?=%x\n",
2655 unifi_notice(priv,
"uf_handle_uspframes_delivery: U-APSD already active! STA=%x:%x:%x:%x:%x:%x\n",
2664 staInfo->uspSuspend =
FALSE;
2665 spin_unlock_irqrestore(&priv->staRecord_lock,lock_flags);
2669 && (!list_empty(&staInfo->
mgtFrames))) {
2672 unifi_trace(priv,
UDBG4,
"uf_handle_uspframes_delivery: Sending buffered management frames\n");
2676 if (!uf_is_more_data_for_delivery_ac(priv, staInfo)) {
2680 if (!staInfo->uspSuspend) {
2683 spin_unlock_irqrestore(&priv->staRecord_lock,lock_flags);
2685 unifi_trace(priv,
UDBG2,
"uf_handle_uspframes_delivery: sending QNull for trigger\n");
2689 unifi_trace(priv,
UDBG2,
"uf_handle_uspframes_delivery: MgtQ xfer suspended\n");
2695 && (!list_empty(&staInfo->
dataPdu[i]))) {
2697 unifi_trace(priv,
UDBG4,
"uf_handle_uspframes_delivery: Buffered data frames from Queue (%d) for USP\n", i);
2698 uf_send_buffered_data_from_delivery_ac(priv, staInfo, i, &staInfo->
dataPdu[i]);
2706 unifi_trace(priv,
UDBG2,
"uf_handle_uspframes_delivery: suspend=%x, DTIM=%x, USP terminated=%s\n",
2717 is_all_ac_deliver_enabled_and_moredata(staInfo, &allDeliveryEnabled, &dataAvailable);
2718 if ((allDeliveryEnabled && !dataAvailable)) {
2721 unifi_trace(priv,
UDBG4,
" --uf_handle_uspframes_delivery, UAPSD timset\n");
2727 unifi_trace(priv,
UDBG2,
" --uf_handle_uspframes_delivery, uapsd active=%x, suspend?=%x\n",
2731 void uf_process_wmm_deliver_ac_uapsd(
unifi_priv_t * priv,
2744 priority = (
CSR_PRIORITY)(qosControl & IEEE802_11_QC_TID_MASK);
2750 srcStaInfo->triggerFramePriority =
priority;
2751 spin_unlock_irqrestore(&priv->staRecord_lock,lock_flags);
2752 unifi_trace(priv,
UDBG2,
"uf_process_wmm_deliver_ac_uapsd: trigger frame, Begin U-APSD, triggerQ=%x\n", priority_q);
2753 uf_handle_uspframes_delivery(priv, srcStaInfo, interfaceTag);
2766 CSR_TRANSMISSION_CONTROL transmissionControl = (TRANSMISSION_CONTROL_EOSP_MASK | TRANSMISSION_CONTROL_TRIGGER_MASK);
2779 unifi_error(priv,
" failed to allocate request_data. in uf_send_qos_null func\n");
2794 unifi_error(priv,
"failed to create MAC header\n");
2818 peerAddress.
a, &signal);
2822 unifi_error(priv,
"failed to send QOS data null packet result: %d\n",r);
2850 unifi_error(priv,
"uf_send_nulldata: Failed to allocate memory for NULL frame\n");
2864 unifi_error(priv,
"uf_send_nulldata: Failed to create MAC header\n");
2889 peerAddress.
a, &signal);
2892 srcStaInfo->nullDataHostTag = req->
HostTag;
2898 unifi_trace(priv,
UDBG1,
"uf_send_nulldata: ENOSPC Requeue the Null frame\n");
2899 enque_tx_data_pdu(priv, &bulkdata, &srcStaInfo->
dataPdu[priority_q], &signal, 1);
2902 spin_unlock_irqrestore(&priv->staRecord_lock,lock_flags);
2907 unifi_error(priv,
"uf_send_nulldata: Failed to send Null frame Error = %d\n",r);
2919 static const CsrWifiMacAddress broadcast_address = {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}};
2922 toDs = (((bulkdata->
d[0].
os_data_ptr)[1]) & 0x01) ? 1 : 0;
2923 fromDs =(((bulkdata->
d[0].
os_data_ptr)[1]) & 0x02) ? 1 : 0;
2930 else if((toDs == 0) && (fromDs ==0))
2958 u8 pmBit,
u16 interfaceTag)
2976 powerSaveChanged =
TRUE;
2978 spin_unlock_irqrestore(&priv->staRecord_lock,lock_flags);
2980 return powerSaveChanged;
2987 powerSaveChanged =
TRUE;
2989 spin_unlock_irqrestore(&priv->staRecord_lock,lock_flags);
2991 return powerSaveChanged;
2998 process_peer_active_transition(priv,srcStaInfo,interfaceTag);
3003 moreData = (!list_empty(&srcStaInfo->
mgtFrames) ||
3023 u8 allDeliveryEnabled = 0, dataAvailable = 0;
3026 is_all_ac_deliver_enabled_and_moredata(srcStaInfo, &allDeliveryEnabled, &dataAvailable);
3028 moreData = (uf_is_more_data_for_non_delivery_ac(srcStaInfo) || (allDeliveryEnabled && dataAvailable));
3047 return powerSaveChanged;
3055 CsrWifiRouterCtrlGetStationRecordFromPeerMacAddress(priv, sa, interfaceTag);
3066 unifi_trace(priv,
UDBG3,
"In uf_process_ps_poll, sta record not found:unexpected frame addr = %x:%x:%x:%x:%x:%x\n",
3067 sa[0], sa[1],sa[2], sa[3], sa[4],sa[5]);
3072 uf_process_pm_bit_for_peer(priv,staRecord,pmBit,interfaceTag);
3075 staRecord->activity_flag =
TRUE;
3085 unifi_notice (priv,
" multicast transmission is going on so don't take action on PS-POLL\n");
3090 if((buffered_pkt=dequeue_tx_data_pdu(priv, &staRecord->
mgtFrames))) {
3096 buffered_pkt->
transmissionControl |= (TRANSMISSION_CONTROL_TRIGGER_MASK | TRANSMISSION_CONTROL_EOSP_MASK);
3097 if((r=frame_and_send_queued_pdu(priv,buffered_pkt,staRecord,moreData,
FALSE)) == -
ENOSPC) {
3099 buffered_pkt->
transmissionControl &= ~(TRANSMISSION_CONTROL_TRIGGER_MASK | TRANSMISSION_CONTROL_EOSP_MASK);
3102 list_add(&buffered_pkt->
q, &staRecord->
mgtFrames);
3103 spin_unlock_irqrestore(&priv->tx_q_lock,lock_flags);
3104 unifi_trace(priv,
UDBG1,
"(ENOSPC) PS-POLL received : PDU sending failed \n");
3108 unifi_trace (priv,
UDBG1,
" HIP validation failure : PDU sending failed \n");
3112 kfree(buffered_pkt);
3119 buffered_pkt->
transmissionControl |= (TRANSMISSION_CONTROL_TRIGGER_MASK | TRANSMISSION_CONTROL_EOSP_MASK);
3120 if((r=frame_and_send_queued_pdu(priv,buffered_pkt,staRecord,moreData,
FALSE)) == -
ENOSPC) {
3122 buffered_pkt->
transmissionControl &= ~(TRANSMISSION_CONTROL_TRIGGER_MASK | TRANSMISSION_CONTROL_EOSP_MASK);
3126 spin_unlock_irqrestore(&priv->tx_q_lock,lock_flags);
3128 unifi_trace(priv,
UDBG1,
"(ENOSPC) PS-POLL received : PDU sending failed \n");
3131 unifi_trace (priv,
UDBG1,
" HIP validation failure : PDU sending failed \n");
3135 kfree(buffered_pkt);
3141 buffered_pkt->
transmissionControl |= (TRANSMISSION_CONTROL_TRIGGER_MASK | TRANSMISSION_CONTROL_EOSP_MASK);
3142 if((r=frame_and_send_queued_pdu(priv,buffered_pkt,staRecord,moreData,
FALSE)) == -
ENOSPC) {
3144 buffered_pkt->
transmissionControl &= ~(TRANSMISSION_CONTROL_TRIGGER_MASK | TRANSMISSION_CONTROL_EOSP_MASK);
3148 spin_unlock_irqrestore(&priv->tx_q_lock,lock_flags);
3150 unifi_trace(priv,
UDBG1,
"(ENOSPC) PS-POLL received : PDU sending failed \n");
3153 unifi_trace (priv,
UDBG1,
" HIP validation failure : PDU sending failed \n");
3157 kfree(buffered_pkt);
3167 unifi_trace(priv,
UDBG3,
"more data = NULL, set tim to 0 in uf_process_ps_poll\n");
3183 u8 allDeliveryEnabled = 0, dataAvailable = 0;
3194 is_all_ac_deliver_enabled_and_moredata(staRecord, &allDeliveryEnabled, &dataAvailable);
3196 if (allDeliveryEnabled) {
3197 unifi_trace(priv,
UDBG3,
"uf_process_ps_poll: All ACs are delivery enable so Sending QOS Null in response of Ps-poll\n");
3198 uf_send_qos_null(priv,interfaceTag,sa,
CSR_QOS_UP0,staRecord);
3202 if (!list_empty(&staRecord->
mgtFrames)) {
3203 if ((buffered_pkt=dequeue_tx_data_pdu(priv, &staRecord->
mgtFrames))) {
3207 moreData = uf_is_more_data_for_non_delivery_ac(staRecord);
3208 buffered_pkt->
transmissionControl |= (TRANSMISSION_CONTROL_TRIGGER_MASK | TRANSMISSION_CONTROL_EOSP_MASK);
3211 if((r=frame_and_send_queued_pdu(priv,buffered_pkt,staRecord,moreData,
FALSE)) == -
ENOSPC) {
3213 buffered_pkt->
transmissionControl &= ~(TRANSMISSION_CONTROL_TRIGGER_MASK | TRANSMISSION_CONTROL_EOSP_MASK);
3216 list_add(&buffered_pkt->
q, &staRecord->
mgtFrames);
3217 spin_unlock_irqrestore(&priv->tx_q_lock,lock_flags);
3219 unifi_trace(priv,
UDBG1,
"(ENOSPC) PS-POLL received : PDU sending failed \n");
3222 unifi_trace (priv,
UDBG1,
" HIP validation failure : PDU sending failed \n");
3226 kfree(buffered_pkt);
3229 unifi_error(priv,
"uf_process_ps_poll: Mgt frame list empty!! \n");
3237 for(i= 3; i>=0; i--) {
3240 if((buffered_pkt=dequeue_tx_data_pdu(priv, &staRecord->
dataPdu[i]))) {
3241 moreData = uf_is_more_data_for_non_delivery_ac(staRecord);
3243 buffered_pkt->
transmissionControl |= (TRANSMISSION_CONTROL_TRIGGER_MASK | TRANSMISSION_CONTROL_EOSP_MASK);
3246 if((r=frame_and_send_queued_pdu(priv,buffered_pkt,staRecord,moreData,
FALSE)) == -
ENOSPC) {
3248 buffered_pkt->
transmissionControl &= ~(TRANSMISSION_CONTROL_TRIGGER_MASK | TRANSMISSION_CONTROL_EOSP_MASK);
3251 list_add(&buffered_pkt->
q, &staRecord->
dataPdu[i]);
3252 spin_unlock_irqrestore(&priv->tx_q_lock,lock_flags);
3254 unifi_trace(priv,
UDBG1,
"(ENOSPC) PS-POLL received : PDU sending failed \n");
3257 unifi_trace (priv,
UDBG1,
" HIP validation failure : PDU sending failed \n");
3261 kfree(buffered_pkt);
3269 is_all_ac_deliver_enabled_and_moredata(staRecord, &allDeliveryEnabled, &dataAvailable);
3271 moreData = (uf_is_more_data_for_non_delivery_ac(staRecord) || (allDeliveryEnabled && dataAvailable));
3273 unifi_trace(priv,
UDBG3,
"more data = NULL, set tim to 0 in uf_process_ps_poll\n");
3303 if(send_cfm_list_item ==
NULL){
3304 unifi_warning(priv,
"%s: Failed to allocate memory for new list item \n");
3308 INIT_LIST_HEAD(&send_cfm_list_item->
q);
3314 send_cfm_list_item->
rate = tx_q_item->
rate;
3321 void uf_prepare_send_cfm_list_for_queued_pkts(
unifi_priv_t * priv,
3340 unifi_error(priv,
"Entry should exist, otherwise it is a (BUG)\n");
3348 unifi_trace(priv,
UDBG1,
"%s: SenderProcessID=%x host tag=%x transmission control=%x\n",
3354 add_to_send_cfm_list(priv, tx_q_item, frames_need_cfm_list);
3358 spin_unlock_irqrestore(&priv->tx_q_lock,lock_flags);
3380 unifi_error(priv,
"entry should exists, otherwise crashes (bug)\n");
3383 "proccess_tx: in uf_flush_list peerMacAddress=%02X%02X%02X%02X%02X%02X senderProcessId=%x\n",
3394 if (!priv->noOfPktQueuedInDriver) {
3397 priv->noOfPktQueuedInDriver--;
3400 spin_unlock_irqrestore(&priv->tx_q_lock,lock_flags);
3413 if (list_empty(txList)) {
3419 if (priv->noOfPktQueuedInDriver == 0xFFFF) {
3431 spin_unlock_irqrestore(&priv->tx_q_lock,lock_flags);
3435 "proccess_tx: In dequeue_tx_data_pdu peerMacAddress=%02X%02X%02X%02X%02X%02X senderProcessId=%x\n",
3447 const u8 *peerMacAddress,
3455 unifi_error(priv,
"interfaceTag is not proper, interfaceTag = %d\n", interfaceTag);
3465 if (interfacePriv->staInfo[i]!=
NULL) {
3468 spin_unlock_irqrestore(&priv->staRecord_lock,lock_flags);
3475 spin_unlock_irqrestore(&priv->staRecord_lock,lock_flags);
3487 unifi_error(priv,
"handle/interfaceTag is not proper, handle = %d, interfaceTag = %d\n", handle, interfaceTag);
3504 if (interfacePriv ==
NULL) {
3505 unifi_trace(priv,
UDBG3,
"uf_check_inactivity: Interface priv is NULL \n");
3512 staInfo = CsrWifiRouterCtrlGetStationRecordFromHandle(priv, i, interfaceTag);
3517 unifi_trace(priv,
UDBG3,
"Running Inactivity handler Time %xus station's last activity %xus\n",
3518 currentTime, staInfo->lastActivity);
3521 elapsedTime = (currentTime >= staInfo->lastActivity)?
3522 (currentTime - staInfo->lastActivity):
3523 (~((
u32)0) - staInfo->lastActivity + currentTime);
3524 spin_unlock_irqrestore(&priv->staRecord_lock,lock_flags);
3530 unifi_trace(priv,
UDBG3,
"Station %x:%x:%x:%x:%x:%x inactive since %xus\n sending Inactive Ind\n",
3531 peerMacAddress.
a[0], peerMacAddress.
a[1],
3532 peerMacAddress.
a[2], peerMacAddress.
a[3],
3533 peerMacAddress.
a[4], peerMacAddress.
a[5],
3540 interfacePriv->last_inactivity_check = currentTime;
3544 void uf_update_sta_activity(
unifi_priv_t *priv,
u16 interfaceTag,
const u8 *peerMacAddress)
3546 CsrTime elapsedTime, currentTime;
3552 if (interfacePriv ==
NULL) {
3553 unifi_trace(priv,
UDBG3,
"uf_check_inactivity: Interface priv is NULL \n");
3560 staInfo = CsrWifiRouterCtrlGetStationRecordFromPeerMacAddress(priv, peerMacAddress, interfaceTag);
3562 if (staInfo ==
NULL) {
3569 staInfo->lastActivity = currentTime;
3576 elapsedTime = (currentTime >= interfacePriv->last_inactivity_check)?
3577 (currentTime - interfacePriv->last_inactivity_check):
3578 (~((
u32)0) - interfacePriv->last_inactivity_check + currentTime);
3580 spin_unlock_irqrestore(&priv->staRecord_lock,lock_flags);
3584 uf_check_inactivity(priv, interfaceTag, currentTime);
3587 void resume_unicast_buffered_frames(
unifi_priv_t *priv,
u16 interfaceTag)
3599 while(!isRouterBufferEnabled(priv,3) &&
3600 ((buffered_pkt=dequeue_tx_data_pdu(priv,&interfacePriv->genericMgtFrames))!=
NULL)) {
3602 ~(TRANSMISSION_CONTROL_TRIGGER_MASK|TRANSMISSION_CONTROL_EOSP_MASK);
3603 if((r=frame_and_send_queued_pdu(priv,buffered_pkt,
NULL,0,
FALSE)) == -
ENOSPC) {
3606 list_add(&buffered_pkt->
q, &interfacePriv->genericMgtFrames);
3607 spin_unlock_irqrestore(&priv->tx_q_lock,lock_flags);
3608 hipslotFree[3]=
FALSE;
3612 unifi_trace (priv,
UDBG1,
" HIP validation failure : PDU sending failed \n");
3616 kfree(buffered_pkt);
3621 if(!hipslotFree[0] && !hipslotFree[1] && !hipslotFree[2] && !hipslotFree[3]) {
3622 unifi_trace(priv,
UDBG3,
"(ENOSPC) in resume_unicast_buffered_frames:: hip slots are full \n");
3626 while(((
TRUE == hipslotFree[3] ) && (buffered_pkt=dequeue_tx_data_pdu(priv, &staInfo->
mgtFrames)))) {
3628 ~(TRANSMISSION_CONTROL_TRIGGER_MASK|TRANSMISSION_CONTROL_EOSP_MASK);
3629 if((r=frame_and_send_queued_pdu(priv,buffered_pkt,staInfo,0,
FALSE)) == -
ENOSPC) {
3630 unifi_trace(priv,
UDBG3,
"(ENOSPC) in resume_unicast_buffered_frames:: hip slots are full for voice queue\n");
3633 list_add(&buffered_pkt->
q, &staInfo->
mgtFrames);
3634 spin_unlock_irqrestore(&priv->tx_q_lock,lock_flags);
3636 hipslotFree[3] =
FALSE;
3640 unifi_trace (priv,
UDBG1,
" HIP validation failure : PDU sending failed \n");
3644 kfree(buffered_pkt);
3652 while((buffered_pkt=dequeue_tx_data_pdu(priv, &staInfo->
dataPdu[j]))) {
3654 ~(TRANSMISSION_CONTROL_TRIGGER_MASK|TRANSMISSION_CONTROL_EOSP_MASK);
3655 if((r=frame_and_send_queued_pdu(priv,buffered_pkt,staInfo,0,
FALSE)) == -
ENOSPC) {
3658 list_add(&buffered_pkt->
q, &staInfo->
dataPdu[j]);
3659 spin_unlock_irqrestore(&priv->tx_q_lock,lock_flags);
3665 unifi_trace (priv,
UDBG1,
" HIP validation failure : PDU sending failed \n");
3669 kfree(buffered_pkt);
3677 void update_eosp_to_head_of_broadcast_list_head(
unifi_priv_t *priv,
u16 interfaceTag)
3687 if (interfacePriv->noOfbroadcastPktQueued) {
3694 list_for_each_safe(listHead, placeHolder, &interfacePriv->genericMulticastOrBroadCastFrames) {
3701 spin_unlock_irqrestore(&priv->tx_q_lock,lock_flags);
3727 staInfo = CsrWifiRouterCtrlGetStationRecordFromHandle(priv,startIndex,interfaceTag);
3736 uf_handle_uspframes_delivery(priv, staInfo, interfaceTag);
3738 unifi_trace(priv,
UDBG2,
"resume_suspended_uapsd: PS state=%x, uapsdActive?=%x, suspend?=%x\n",
3744 staInfo->uspSuspend =
FALSE;
3745 spin_unlock_irqrestore(&priv->staRecord_lock,lock_flags);