Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 236518
b: refs/heads/master
c: 9a77bd5
h: refs/heads/master
v: v3
  • Loading branch information
Mike McCormack authored and Greg Kroah-Hartman committed Mar 14, 2011
1 parent 6da37e2 commit 09103b1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f19dbc0ca8aa8bac415857c14be4252c38b1d925
refs/heads/master: 9a77bd58f6bfe05df7ec807c22be40fb2dc62e23
2 changes: 2 additions & 0 deletions trunk/drivers/staging/rtl8192e/r8192E.h
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,8 @@ struct rtl8192_tx_ring {
typedef struct r8192_priv
{
struct pci_dev *pdev;
u8 *mem_start;

/* maintain info from eeprom */
short epromtype;
u16 eeprom_vid;
Expand Down
38 changes: 15 additions & 23 deletions trunk/drivers/staging/rtl8192e/r8192E_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,40 +210,34 @@ u32 read_cam(struct r8192_priv *priv, u8 addr)

u8 read_nic_byte(struct r8192_priv *priv, int x)
{
struct net_device *dev = priv->ieee80211->dev;
return 0xff&readb((u8*)dev->mem_start +x);
return 0xff & readb(priv->mem_start + x);
}

u32 read_nic_dword(struct r8192_priv *priv, int x)
{
struct net_device *dev = priv->ieee80211->dev;
return readl((u8*)dev->mem_start +x);
return readl(priv->mem_start + x);
}

u16 read_nic_word(struct r8192_priv *priv, int x)
{
struct net_device *dev = priv->ieee80211->dev;
return readw((u8*)dev->mem_start +x);
return readw(priv->mem_start + x);
}

void write_nic_byte(struct r8192_priv *priv, int x,u8 y)
{
struct net_device *dev = priv->ieee80211->dev;
writeb(y,(u8*)dev->mem_start +x);
writeb(y, priv->mem_start + x);
udelay(20);
}

void write_nic_dword(struct r8192_priv *priv, int x,u32 y)
{
struct net_device *dev = priv->ieee80211->dev;
writel(y,(u8*)dev->mem_start +x);
writel(y, priv->mem_start + x);
udelay(20);
}

void write_nic_word(struct r8192_priv *priv, int x,u16 y)
{
struct net_device *dev = priv->ieee80211->dev;
writew(y,(u8*)dev->mem_start +x);
writew(y, priv->mem_start + x);
udelay(20);
}

Expand Down Expand Up @@ -4568,7 +4562,6 @@ static const struct net_device_ops rtl8192_netdev_ops = {
static int __devinit rtl8192_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *id)
{
unsigned long ioaddr = 0;
struct net_device *dev = NULL;
struct r8192_priv *priv= NULL;
u8 unit = 0;
Expand Down Expand Up @@ -4619,16 +4612,15 @@ static int __devinit rtl8192_pci_probe(struct pci_dev *pdev,
goto fail;
}


ioaddr = (unsigned long)ioremap_nocache( pmem_start, pmem_len);
if( ioaddr == (unsigned long)NULL ){
priv->mem_start = ioremap_nocache(pmem_start, pmem_len);
if (!priv->mem_start) {
RT_TRACE(COMP_ERR,"ioremap failed!\n");
// release_mem_region( pmem_start, pmem_len );
goto fail1;
}

dev->mem_start = ioaddr; // shared mem start
dev->mem_end = ioaddr + pci_resource_len(pdev, 0); // shared mem end
dev->mem_start = (unsigned long) priv->mem_start;
dev->mem_end = (unsigned long) (priv->mem_start +
pci_resource_len(pdev, 0));

/* We disable the RETRY_TIMEOUT register (0x41) to keep
* PCI Tx retries from interfering with C3 CPU state */
Expand Down Expand Up @@ -4670,8 +4662,8 @@ static int __devinit rtl8192_pci_probe(struct pci_dev *pdev,

fail1:

if( dev->mem_start != (unsigned long)NULL ){
iounmap( (void *)dev->mem_start );
if (priv->mem_start) {
iounmap(priv->mem_start);
release_mem_region( pci_resource_start(pdev, 1),
pci_resource_len(pdev, 1) );
}
Expand Down Expand Up @@ -4747,8 +4739,8 @@ static void __devexit rtl8192_pci_disconnect(struct pci_dev *pdev)
priv->irq=0;
}

if( dev->mem_start != (unsigned long)NULL ){
iounmap( (void *)dev->mem_start );
if (priv->mem_start) {
iounmap(priv->mem_start);
release_mem_region( pci_resource_start(pdev, 1),
pci_resource_len(pdev, 1) );
}
Expand Down

0 comments on commit 09103b1

Please sign in to comment.