Commit 1e16cb17 authored by Mateusz Kulikowski's avatar Mateusz Kulikowski Committed by Greg Kroah-Hartman

staging: rtl8192e: Remove read|write_nic_io_(d)word|byte()

None of this functions was used.
Also remove PlatformIOCheckPageLegalAndGetRegMask() used by them.
Signed-off-by: default avatarMateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 632751b5
......@@ -90,164 +90,6 @@ static struct pci_driver rtl8192_pci_driver = {
/****************************************************************************
-----------------------------IO STUFF-------------------------
*****************************************************************************/
static bool PlatformIOCheckPageLegalAndGetRegMask(u32 u4bPage, u8 *pu1bPageMask)
{
bool bReturn = false;
*pu1bPageMask = 0xfe;
switch (u4bPage) {
case 1: case 2: case 3: case 4:
case 8: case 9: case 10: case 12: case 13:
bReturn = true;
*pu1bPageMask = 0xf0;
break;
default:
bReturn = false;
break;
}
return bReturn;
}
void write_nic_io_byte(struct net_device *dev, int x, u8 y)
{
u32 u4bPage = x >> 8;
u8 u1PageMask = 0;
bool bIsLegalPage = false;
if (u4bPage == 0) {
outb(y&0xff, dev->base_addr + x);
} else {
bIsLegalPage = PlatformIOCheckPageLegalAndGetRegMask(u4bPage,
&u1PageMask);
if (bIsLegalPage) {
u8 u1bPsr = read_nic_io_byte(dev, PSR);
write_nic_io_byte(dev, PSR, ((u1bPsr & u1PageMask) |
(u8)u4bPage));
write_nic_io_byte(dev, (x & 0xff), y);
write_nic_io_byte(dev, PSR, (u1bPsr & u1PageMask));
}
}
}
void write_nic_io_word(struct net_device *dev, int x, u16 y)
{
u32 u4bPage = x >> 8;
u8 u1PageMask = 0;
bool bIsLegalPage = false;
if (u4bPage == 0) {
outw(y, dev->base_addr + x);
} else {
bIsLegalPage = PlatformIOCheckPageLegalAndGetRegMask(u4bPage,
&u1PageMask);
if (bIsLegalPage) {
u8 u1bPsr = read_nic_io_byte(dev, PSR);
write_nic_io_byte(dev, PSR, ((u1bPsr & u1PageMask) |
(u8)u4bPage));
write_nic_io_word(dev, (x & 0xff), y);
write_nic_io_byte(dev, PSR, (u1bPsr & u1PageMask));
}
}
}
void write_nic_io_dword(struct net_device *dev, int x, u32 y)
{
u32 u4bPage = x >> 8;
u8 u1PageMask = 0;
bool bIsLegalPage = false;
if (u4bPage == 0) {
outl(y, dev->base_addr + x);
} else {
bIsLegalPage = PlatformIOCheckPageLegalAndGetRegMask(u4bPage,
&u1PageMask);
if (bIsLegalPage) {
u8 u1bPsr = read_nic_io_byte(dev, PSR);
write_nic_io_byte(dev, PSR, ((u1bPsr & u1PageMask) |
(u8)u4bPage));
write_nic_io_dword(dev, (x & 0xff), y);
write_nic_io_byte(dev, PSR, (u1bPsr & u1PageMask));
}
}
}
u8 read_nic_io_byte(struct net_device *dev, int x)
{
u32 u4bPage = x >> 8;
u8 u1PageMask = 0;
bool bIsLegalPage = false;
u8 Data = 0;
if (u4bPage == 0)
return 0xff&inb(dev->base_addr + x);
bIsLegalPage = PlatformIOCheckPageLegalAndGetRegMask(u4bPage,
&u1PageMask);
if (bIsLegalPage) {
u8 u1bPsr = read_nic_io_byte(dev, PSR);
write_nic_io_byte(dev, PSR, ((u1bPsr & u1PageMask) |
(u8)u4bPage));
Data = read_nic_io_byte(dev, (x & 0xff));
write_nic_io_byte(dev, PSR, (u1bPsr & u1PageMask));
}
return Data;
}
u16 read_nic_io_word(struct net_device *dev, int x)
{
u32 u4bPage = x >> 8;
u8 u1PageMask = 0;
bool bIsLegalPage = false;
u16 Data = 0;
if (u4bPage == 0)
return inw(dev->base_addr + x);
bIsLegalPage = PlatformIOCheckPageLegalAndGetRegMask(u4bPage,
&u1PageMask);
if (bIsLegalPage) {
u8 u1bPsr = read_nic_io_byte(dev, PSR);
write_nic_io_byte(dev, PSR, ((u1bPsr & u1PageMask) |
(u8)u4bPage));
Data = read_nic_io_word(dev, (x & 0xff));
write_nic_io_byte(dev, PSR, (u1bPsr & u1PageMask));
}
return Data;
}
u32 read_nic_io_dword(struct net_device *dev, int x)
{
u32 u4bPage = x >> 8;
u8 u1PageMask = 0;
bool bIsLegalPage = false;
u32 Data = 0;
if (u4bPage == 0)
return inl(dev->base_addr + x);
bIsLegalPage = PlatformIOCheckPageLegalAndGetRegMask(u4bPage,
&u1PageMask);
if (bIsLegalPage) {
u8 u1bPsr = read_nic_io_byte(dev, PSR);
write_nic_io_byte(dev, PSR, ((u1bPsr & u1PageMask) |
(u8)u4bPage));
Data = read_nic_io_dword(dev, (x & 0xff));
write_nic_io_byte(dev, PSR, (u1bPsr & u1PageMask));
}
return Data;
}
u8 read_nic_byte(struct net_device *dev, int x)
{
......
......@@ -581,13 +581,6 @@ extern const struct ethtool_ops rtl819x_ethtool_ops;
void rtl8192_tx_cmd(struct net_device *dev, struct sk_buff *skb);
short rtl8192_tx(struct net_device *dev, struct sk_buff *skb);
u8 read_nic_io_byte(struct net_device *dev, int x);
u32 read_nic_io_dword(struct net_device *dev, int x);
u16 read_nic_io_word(struct net_device *dev, int x);
void write_nic_io_byte(struct net_device *dev, int x, u8 y);
void write_nic_io_word(struct net_device *dev, int x, u16 y);
void write_nic_io_dword(struct net_device *dev, int x, u32 y);
u8 read_nic_byte(struct net_device *dev, int x);
u32 read_nic_dword(struct net_device *dev, int x);
u16 read_nic_word(struct net_device *dev, int x);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment