Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 067ba6cf authored by Mike McCormack's avatar Mike McCormack Committed by Greg Kroah-Hartman
Browse files

Staging: rtl8192e: Clean formatting in rtl8192_tx()

parent 4b37700d
Loading
Loading
Loading
Loading
+141 −148
Original line number Original line Diff line number Diff line
@@ -1383,7 +1383,8 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff* skb)
	int idx;
	int idx;


	if (priv->bdisable_nic) {
	if (priv->bdisable_nic) {
       	RT_TRACE(COMP_ERR,"%s: ERR!! Nic is disabled! Can't tx packet len=%d qidx=%d!!!\n", __FUNCTION__, skb->len, tcb_desc->queue_index);
		RT_TRACE(COMP_ERR, "Nic is disabled! Can't tx packet len=%d qidx=%d!!!\n",
			 skb->len, tcb_desc->queue_index);
		return skb->len;
		return skb->len;
	}
	}


@@ -1392,6 +1393,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff* skb)
#endif
#endif


	mapping = pci_map_single(priv->pdev, skb->data, skb->len, PCI_DMA_TODEVICE);
	mapping = pci_map_single(priv->pdev, skb->data, skb->len, PCI_DMA_TODEVICE);

	/* collect the tx packets statitcs */
	/* collect the tx packets statitcs */
	pda_addr = ((u8 *)skb->data) + sizeof(TX_FWINFO_8190PCI);
	pda_addr = ((u8 *)skb->data) + sizeof(TX_FWINFO_8190PCI);
	if (is_multicast_ether_addr(pda_addr))
	if (is_multicast_ether_addr(pda_addr))
@@ -1427,9 +1429,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff* skb)
		pTxFwInfo->RxAMD = 0;
		pTxFwInfo->RxAMD = 0;
	}
	}


    //
	/* Protection mode related */
    // Protection mode related
    //
	pTxFwInfo->RtsEnable = (tcb_desc->bRTSEnable) ? 1 : 0;
	pTxFwInfo->RtsEnable = (tcb_desc->bRTSEnable) ? 1 : 0;
	pTxFwInfo->CtsEnable = (tcb_desc->bCTSEnable) ? 1 : 0;
	pTxFwInfo->CtsEnable = (tcb_desc->bCTSEnable) ? 1 : 0;
	pTxFwInfo->RtsSTBC = (tcb_desc->bRTSSTBC) ? 1 : 0;
	pTxFwInfo->RtsSTBC = (tcb_desc->bRTSSTBC) ? 1 : 0;
@@ -1438,22 +1438,18 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff* skb)
	pTxFwInfo->RtsBandwidth = 0;
	pTxFwInfo->RtsBandwidth = 0;
	pTxFwInfo->RtsSubcarrier = tcb_desc->RTSSC;
	pTxFwInfo->RtsSubcarrier = tcb_desc->RTSSC;
	pTxFwInfo->RtsShort = (pTxFwInfo->RtsHT == 0) ? (tcb_desc->bRTSUseShortPreamble ? 1 : 0) : (tcb_desc->bRTSUseShortGI? 1 : 0);
	pTxFwInfo->RtsShort = (pTxFwInfo->RtsHT == 0) ? (tcb_desc->bRTSUseShortPreamble ? 1 : 0) : (tcb_desc->bRTSUseShortGI? 1 : 0);
    //

    // Set Bandwidth and sub-channel settings.
	/* Set Bandwidth and sub-channel settings. */
    //
	if (priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20_40) {
    if(priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20_40)
		if (tcb_desc->bPacketBW) {
    {
        if(tcb_desc->bPacketBW)
        {
			pTxFwInfo->TxBandwidth = 1;
			pTxFwInfo->TxBandwidth = 1;
#ifdef RTL8190P
#ifdef RTL8190P
			pTxFwInfo->TxSubCarrier = 3;
			pTxFwInfo->TxSubCarrier = 3;
#else
#else
            pTxFwInfo->TxSubCarrier = 0;	//By SD3's Jerry suggestion, use duplicated mode, cosa 04012008
			/* use duplicated mode */
			pTxFwInfo->TxSubCarrier = 0;
#endif
#endif
        }
		} else {
        else
        {
			pTxFwInfo->TxBandwidth = 0;
			pTxFwInfo->TxBandwidth = 0;
			pTxFwInfo->TxSubCarrier = priv->nCur40MhzPrimeSC;
			pTxFwInfo->TxSubCarrier = priv->nCur40MhzPrimeSC;
		}
		}
@@ -1464,11 +1460,10 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff* skb)


	spin_lock_irqsave(&priv->irq_th_lock, flags);
	spin_lock_irqsave(&priv->irq_th_lock, flags);
	ring = &priv->tx_ring[tcb_desc->queue_index];
	ring = &priv->tx_ring[tcb_desc->queue_index];
    if (tcb_desc->queue_index != BEACON_QUEUE) {
	if (tcb_desc->queue_index != BEACON_QUEUE)
		idx = (ring->idx + skb_queue_len(&ring->queue)) % ring->entries;
		idx = (ring->idx + skb_queue_len(&ring->queue)) % ring->entries;
    } else {
	else
		idx = 0;
		idx = 0;
    }


	pdesc = &ring->desc[idx];
	pdesc = &ring->desc[idx];
	if ((pdesc->OWN == 1) && (tcb_desc->queue_index != BEACON_QUEUE)) {
	if ((pdesc->OWN == 1) && (tcb_desc->queue_index != BEACON_QUEUE)) {
@@ -1479,18 +1474,18 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff* skb)
	}
	}


	/* fill tx descriptor */
	/* fill tx descriptor */
    memset((u8*)pdesc,0,12);
	memset(pdesc, 0, 12);

	/*DWORD 0*/
	/*DWORD 0*/
	pdesc->LINIP = 0;
	pdesc->LINIP = 0;
	pdesc->CmdInit = 1;
	pdesc->CmdInit = 1;
    pdesc->Offset = sizeof(TX_FWINFO_8190PCI) + 8; //We must add 8!! Emily
	pdesc->Offset = sizeof(TX_FWINFO_8190PCI) + 8; /* We must add 8!! */
	pdesc->PktSize = (u16)skb->len-sizeof(TX_FWINFO_8190PCI);
	pdesc->PktSize = (u16)skb->len-sizeof(TX_FWINFO_8190PCI);


	/*DWORD 1*/
	/*DWORD 1*/
	pdesc->SecCAMID = 0;
	pdesc->SecCAMID = 0;
	pdesc->RATid = tcb_desc->RATRIndex;
	pdesc->RATid = tcb_desc->RATRIndex;



	pdesc->NoEnc = 1;
	pdesc->NoEnc = 1;
	pdesc->SecType = 0x0;
	pdesc->SecType = 0x0;
	if (tcb_desc->bHwSec) {
	if (tcb_desc->bHwSec) {
@@ -1515,9 +1510,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff* skb)
		}
		}
	}
	}


    //
	/* Set Packet ID */
    // Set Packet ID
    //
	pdesc->PktId = 0x0;
	pdesc->PktId = 0x0;


	pdesc->QueueSelect = MapHwQueueToFirmwareQueue(tcb_desc->queue_index);
	pdesc->QueueSelect = MapHwQueueToFirmwareQueue(tcb_desc->queue_index);