staging: vt6655: remove duplicate MACvSetPacketFilter
Packet filtering is already done in vnt_configure. A call to MACvSetPacketFilter is not necessary in MACvInitialize as this will be done by vnt_configure when interface is up. Also remove macros associated with this function. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
6d8b588c32
commit
da4f18ed3b
|
@ -33,7 +33,6 @@
|
||||||
* MACvGetShortRetryLimit - Get 802.11 Short Retry limit
|
* MACvGetShortRetryLimit - Get 802.11 Short Retry limit
|
||||||
* MACvSetLongRetryLimit - Set 802.11 Long Retry limit
|
* MACvSetLongRetryLimit - Set 802.11 Long Retry limit
|
||||||
* MACvSetLoopbackMode - Set MAC Loopback Mode
|
* MACvSetLoopbackMode - Set MAC Loopback Mode
|
||||||
* MACvSetPacketFilter - Set MAC Address Filter
|
|
||||||
* MACvSaveContext - Save Context of MAC Registers
|
* MACvSaveContext - Save Context of MAC Registers
|
||||||
* MACvRestoreContext - Restore Context of MAC Registers
|
* MACvRestoreContext - Restore Context of MAC Registers
|
||||||
* MACbSoftwareReset - Software Reset MAC
|
* MACbSoftwareReset - Software Reset MAC
|
||||||
|
@ -213,66 +212,6 @@ void MACvSetLoopbackMode(void __iomem *dwIoBase, unsigned char byLoopbackMode)
|
||||||
VNSvOutPortB(dwIoBase + MAC_REG_TEST, byOrgValue);
|
VNSvOutPortB(dwIoBase + MAC_REG_TEST, byOrgValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Description:
|
|
||||||
* Set MAC Address filter
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* In:
|
|
||||||
* dwIoBase - Base Address for MAC
|
|
||||||
* wFilterType - Filter Type
|
|
||||||
* Out:
|
|
||||||
* none
|
|
||||||
*
|
|
||||||
* Return Value: none
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void MACvSetPacketFilter(void __iomem *dwIoBase, unsigned short wFilterType)
|
|
||||||
{
|
|
||||||
unsigned char byOldRCR;
|
|
||||||
unsigned char byNewRCR = 0;
|
|
||||||
|
|
||||||
// if only in DIRECTED mode, multicast-address will set to zero,
|
|
||||||
// but if other mode exist (e.g. PROMISCUOUS), multicast-address
|
|
||||||
// will be open
|
|
||||||
if (wFilterType & PKT_TYPE_DIRECTED) {
|
|
||||||
// set multicast address to accept none
|
|
||||||
MACvSelectPage1(dwIoBase);
|
|
||||||
VNSvOutPortD(dwIoBase + MAC_REG_MAR0, 0L);
|
|
||||||
VNSvOutPortD(dwIoBase + MAC_REG_MAR0 + sizeof(unsigned long), 0L);
|
|
||||||
MACvSelectPage0(dwIoBase);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wFilterType & (PKT_TYPE_PROMISCUOUS | PKT_TYPE_ALL_MULTICAST)) {
|
|
||||||
// set multicast address to accept all
|
|
||||||
MACvSelectPage1(dwIoBase);
|
|
||||||
VNSvOutPortD(dwIoBase + MAC_REG_MAR0, 0xFFFFFFFFL);
|
|
||||||
VNSvOutPortD(dwIoBase + MAC_REG_MAR0 + sizeof(unsigned long), 0xFFFFFFFFL);
|
|
||||||
MACvSelectPage0(dwIoBase);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wFilterType & PKT_TYPE_PROMISCUOUS) {
|
|
||||||
byNewRCR |= (RCR_RXALLTYPE | RCR_UNICAST | RCR_MULTICAST | RCR_BROADCAST);
|
|
||||||
|
|
||||||
byNewRCR &= ~RCR_BSSID;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wFilterType & (PKT_TYPE_ALL_MULTICAST | PKT_TYPE_MULTICAST))
|
|
||||||
byNewRCR |= RCR_MULTICAST;
|
|
||||||
|
|
||||||
if (wFilterType & PKT_TYPE_BROADCAST)
|
|
||||||
byNewRCR |= RCR_BROADCAST;
|
|
||||||
|
|
||||||
if (wFilterType & PKT_TYPE_ERROR_CRC)
|
|
||||||
byNewRCR |= RCR_ERRCRC;
|
|
||||||
|
|
||||||
VNSvInPortB(dwIoBase + MAC_REG_RCR, &byOldRCR);
|
|
||||||
if (byNewRCR != byOldRCR) {
|
|
||||||
// Modify the Receive Command Register
|
|
||||||
VNSvOutPortB(dwIoBase + MAC_REG_RCR, byNewRCR);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Description:
|
* Description:
|
||||||
* Save MAC registers to context buffer
|
* Save MAC registers to context buffer
|
||||||
|
@ -629,11 +568,6 @@ void MACvInitialize(void __iomem *dwIoBase)
|
||||||
VNSvOutPortB(dwIoBase + MAC_REG_TFTCTL, TFTCTL_TSFCNTRST);
|
VNSvOutPortB(dwIoBase + MAC_REG_TFTCTL, TFTCTL_TSFCNTRST);
|
||||||
// enable TSF counter
|
// enable TSF counter
|
||||||
VNSvOutPortB(dwIoBase + MAC_REG_TFTCTL, TFTCTL_TSFCNTREN);
|
VNSvOutPortB(dwIoBase + MAC_REG_TFTCTL, TFTCTL_TSFCNTREN);
|
||||||
|
|
||||||
// set packet filter
|
|
||||||
// receive directed and broadcast address
|
|
||||||
|
|
||||||
MACvSetPacketFilter(dwIoBase, PKT_TYPE_DIRECTED | PKT_TYPE_BROADCAST);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -574,17 +574,6 @@
|
||||||
#define MAC_LB_INTERNAL 0x01 //
|
#define MAC_LB_INTERNAL 0x01 //
|
||||||
#define MAC_LB_NONE 0x00 //
|
#define MAC_LB_NONE 0x00 //
|
||||||
|
|
||||||
// Ethernet address filter type
|
|
||||||
#define PKT_TYPE_NONE 0x00 // turn off receiver
|
|
||||||
#define PKT_TYPE_ALL_MULTICAST 0x80
|
|
||||||
#define PKT_TYPE_PROMISCUOUS 0x40
|
|
||||||
#define PKT_TYPE_DIRECTED 0x20 // obsolete, directed address is always accepted
|
|
||||||
#define PKT_TYPE_BROADCAST 0x10
|
|
||||||
#define PKT_TYPE_MULTICAST 0x08
|
|
||||||
#define PKT_TYPE_ERROR_WPA 0x04
|
|
||||||
#define PKT_TYPE_ERROR_CRC 0x02
|
|
||||||
#define PKT_TYPE_BSSID 0x01
|
|
||||||
|
|
||||||
#define Default_BI 0x200
|
#define Default_BI 0x200
|
||||||
|
|
||||||
// MiscFIFO Offset
|
// MiscFIFO Offset
|
||||||
|
@ -976,8 +965,6 @@ void MACvGetLongRetryLimit(void __iomem *dwIoBase, unsigned char *pbyRetryLimit)
|
||||||
|
|
||||||
void MACvSetLoopbackMode(void __iomem *dwIoBase, unsigned char byLoopbackMode);
|
void MACvSetLoopbackMode(void __iomem *dwIoBase, unsigned char byLoopbackMode);
|
||||||
|
|
||||||
void MACvSetPacketFilter(void __iomem *dwIoBase, unsigned short wFilterType);
|
|
||||||
|
|
||||||
void MACvSaveContext(void __iomem *dwIoBase, unsigned char *pbyCxtBuf);
|
void MACvSaveContext(void __iomem *dwIoBase, unsigned char *pbyCxtBuf);
|
||||||
void MACvRestoreContext(void __iomem *dwIoBase, unsigned char *pbyCxtBuf);
|
void MACvRestoreContext(void __iomem *dwIoBase, unsigned char *pbyCxtBuf);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue