| 1 |
diff -ur ../rt2570-cvs-20050824/Module/mlme.c ./Module/mlme.c |
| 2 |
--- ../rt2570-cvs-20050824/Module/mlme.c 2005-08-17 11:00:39.000000000 +0200 |
| 3 |
+++ ./Module/mlme.c 2005-08-24 11:53:01.000000000 +0200 |
| 4 |
@@ -1690,7 +1690,7 @@ |
| 5 |
} |
| 6 |
else |
| 7 |
{ |
| 8 |
- pAd->PortCfg.TxRate = min((INT)(pAd->PortCfg.MaxTxRate), RATE_11); |
| 9 |
+ pAd->PortCfg.TxRate = min((INT)(pAd->PortCfg.MaxTxRate), RATE_5_5); |
| 10 |
} |
| 11 |
} |
| 12 |
} |
| 13 |
diff -ur ../rt2570-cvs-20050824/Module/rtusb_bulk.c ./Module/rtusb_bulk.c |
| 14 |
--- ../rt2570-cvs-20050824/Module/rtusb_bulk.c 2005-07-19 10:20:46.000000000 +0200 |
| 15 |
+++ ./Module/rtusb_bulk.c 2005-08-24 15:40:14.000000000 +0200 |
| 16 |
@@ -107,7 +107,8 @@ |
| 17 |
NdisReleaseSpinLock(&pAdapter->BulkOutLock); |
| 18 |
return; |
| 19 |
} |
| 20 |
- else if (pAdapter->MediaState == NdisMediaStateDisconnected) |
| 21 |
+ else if (pAdapter->MediaState == NdisMediaStateDisconnected && |
| 22 |
+ pAdapter->PortCfg.BssType != BSS_MONITOR) |
| 23 |
{ |
| 24 |
// |
| 25 |
// Since there is no connection, so we need to empty the Tx Bulk out Ring. |
| 26 |
diff -ur ../rt2570-cvs-20050824/Module/rtusb_data.c ./Module/rtusb_data.c |
| 27 |
--- ../rt2570-cvs-20050824/Module/rtusb_data.c 2005-08-17 11:00:39.000000000 +0200 |
| 28 |
+++ ./Module/rtusb_data.c 2005-08-24 15:37:06.000000000 +0200 |
| 29 |
@@ -84,7 +84,8 @@ |
| 30 |
return 0; |
| 31 |
} |
| 32 |
// Drop packets if no associations |
| 33 |
- else if (!INFRA_ON(pAdapter) && !ADHOC_ON(pAdapter)) |
| 34 |
+ else if (!INFRA_ON(pAdapter) && !ADHOC_ON(pAdapter) && |
| 35 |
+ pAdapter->PortCfg.BssType != BSS_MONITOR) |
| 36 |
{ |
| 37 |
RTUSBFreeSkbBuffer(skb); |
| 38 |
return 0; |
| 39 |
@@ -141,6 +142,14 @@ |
| 40 |
Priority = 0; |
| 41 |
AccessCategory = 0; |
| 42 |
|
| 43 |
+ if (skb && pAdapter->PortCfg.BssType == BSS_MONITOR) |
| 44 |
+ { |
| 45 |
+ NdisAcquireSpinLock(&pAdapter->SendTxWaitQueueLock); |
| 46 |
+ skb_queue_tail(&pAdapter->SendTxWaitQueue, skb); |
| 47 |
+ NdisReleaseSpinLock(&pAdapter->SendTxWaitQueueLock); |
| 48 |
+ return (NDIS_STATUS_SUCCESS); |
| 49 |
+ } |
| 50 |
+ |
| 51 |
if (skb) |
| 52 |
{ |
| 53 |
Priority = skb->priority; |
| 54 |
@@ -806,6 +815,36 @@ |
| 55 |
DBGPRINT(RT_DEBUG_ERROR, "Error, Null skb data buffer!!!\n"); |
| 56 |
return (NDIS_STATUS_FAILURE); |
| 57 |
} |
| 58 |
+ |
| 59 |
+ if (pAdapter->PortCfg.BssType == BSS_MONITOR) |
| 60 |
+ { |
| 61 |
+ pTxContext = &pAdapter->TxContext[pAdapter->NextTxIndex]; |
| 62 |
+ pTxContext->InUse = TRUE; |
| 63 |
+ pTxContext->LastOne = TRUE; |
| 64 |
+ |
| 65 |
+ pAdapter->NextTxIndex++; |
| 66 |
+ if (pAdapter->NextTxIndex >= TX_RING_SIZE) |
| 67 |
+ pAdapter->NextTxIndex = 0; |
| 68 |
+ |
| 69 |
+ pTxD = &(pTxContext->TransferBuffer->TxDesc); |
| 70 |
+ memset(pTxD, 0, sizeof(TXD_STRUC)); |
| 71 |
+ pDest = pTxContext->TransferBuffer->WirelessPacket; |
| 72 |
+ |
| 73 |
+ memcpy( pDest, skb->data, skb->len ); |
| 74 |
+ |
| 75 |
+ RTUSBWriteTxDescriptor(pTxD, FALSE, 0, FALSE, FALSE, TRUE, IFS_BACKOFF, skb->len, FALSE, 0, CW_MIN_IN_BITS, CW_MAX_IN_BITS, skb->len + 4, pAdapter->PortCfg.TxRate, 4, pAdapter->PortCfg.TxPreambleInUsed); |
| 76 |
+ |
| 77 |
+ TransferBufferLength = skb->len + sizeof(TXD_STRUC); |
| 78 |
+ if ((TransferBufferLength % 2) == 1) |
| 79 |
+ TransferBufferLength++; |
| 80 |
+ |
| 81 |
+ pTxContext->BulkOutSize = TransferBufferLength; |
| 82 |
+ atomic_inc(&pAdapter->TxCount); |
| 83 |
+ RTUSB_SET_BULK_FLAG(pAdapter, fRTUSB_BULK_OUT_DATA_FRAG); |
| 84 |
+ RTUSBFreeSkbBuffer(skb); |
| 85 |
+ return (NDIS_STATUS_SUCCESS); |
| 86 |
+ } |
| 87 |
+ |
| 88 |
if (NdisBufferLength < 14) |
| 89 |
{ |
| 90 |
DBGPRINT_RAW(RT_DEBUG_ERROR, "RTUSBHardEncrypt --> Ndis Packet buffer error !!!\n"); |
| 91 |
diff -ur ../rt2570-cvs-20050824/Module/rtusb_info.c ./Module/rtusb_info.c |
| 92 |
--- ../rt2570-cvs-20050824/Module/rtusb_info.c 2005-08-17 11:00:39.000000000 +0200 |
| 93 |
+++ ./Module/rtusb_info.c 2005-08-24 12:11:05.000000000 +0200 |
| 94 |
@@ -200,6 +200,12 @@ |
| 95 |
pAdapter->PortCfg.IbssConfig.Channel = chan; |
| 96 |
DBGPRINT(RT_DEBUG_ERROR, "<==SIOCSIWFREQ[cmd=0x%x] (Channel=%d)\n", SIOCSIWFREQ, pAdapter->PortCfg.IbssConfig.Channel); |
| 97 |
|
| 98 |
+ if (pAdapter->PortCfg.BssType == BSS_MONITOR) |
| 99 |
+ { |
| 100 |
+ pAdapter->PortCfg.Channel = pAdapter->PortCfg.IbssConfig.Channel; |
| 101 |
+ AsicSwitchChannel(pAdapter, pAdapter->PortCfg.Channel); |
| 102 |
+ AsicLockChannel(pAdapter, pAdapter->PortCfg.Channel); |
| 103 |
+ } |
| 104 |
|
| 105 |
return 0; |
| 106 |
} |
| 107 |
@@ -288,10 +294,15 @@ |
| 108 |
__u32 *mode, char *extra) |
| 109 |
{ |
| 110 |
PRT2570ADAPTER pAdapter = (PRT2570ADAPTER) dev->priv; |
| 111 |
- if (ADHOC_ON(pAdapter)) |
| 112 |
- *mode = IW_MODE_ADHOC; |
| 113 |
+ if (pAdapter->PortCfg.BssType == BSS_MONITOR) |
| 114 |
+ *mode = IW_MODE_MONITOR; |
| 115 |
else |
| 116 |
- *mode = IW_MODE_INFRA; |
| 117 |
+ { |
| 118 |
+ if (ADHOC_ON(pAdapter)) |
| 119 |
+ *mode = IW_MODE_ADHOC; |
| 120 |
+ else |
| 121 |
+ *mode = IW_MODE_INFRA; |
| 122 |
+ } |
| 123 |
DBGPRINT(RT_DEBUG_TEMP,"--->rtusb_ioctl_giwmode\n"); |
| 124 |
return 0; |
| 125 |
} |
| 126 |
diff -ur ../rt2570-cvs-20050824/Module/sync.c ./Module/sync.c |
| 127 |
--- ../rt2570-cvs-20050824/Module/sync.c 2005-07-27 17:54:29.000000000 +0200 |
| 128 |
+++ ./Module/sync.c 2005-08-24 14:31:58.000000000 +0200 |
| 129 |
@@ -203,6 +203,9 @@ |
| 130 |
UCHAR Ssid[MAX_LEN_OF_SSID], SsidLen, ScanType, BssType; |
| 131 |
ULONG Now; |
| 132 |
|
| 133 |
+ if (pAd->PortCfg.BssType == BSS_MONITOR) |
| 134 |
+ return; |
| 135 |
+ |
| 136 |
DBGPRINT(RT_DEBUG_INFO, "SYNC - MlmeScanReqAction\n"); |
| 137 |
#if 0 |
| 138 |
// Check the total scan tries for one single OID command |