Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 228111
b: refs/heads/master
c: baebc16
h: refs/heads/master
i:
  228109: a694a1e
  228107: d823464
  228103: a5bec1b
  228095: f7e67f0
v: v3
  • Loading branch information
Brett Rudley authored and Greg Kroah-Hartman committed Nov 16, 2010
1 parent 519ea34 commit 86b93f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 43 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: f96c377ead5ed308f0cf18b9156f86fdf207a288
refs/heads/master: baebc160c12ba88baf201d35ecc22f1e250aad3f
47 changes: 5 additions & 42 deletions trunk/drivers/staging/brcm80211/util/linux_osl.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
#include <pcicfg.h>


#define PCI_CFG_RETRY 10

#define OS_HANDLE_MAGIC 0x1234abcd /* Magic # to recognise osh */
#define BCM_MEM_FILENAME_LEN 24 /* Mem. filename length */

Expand Down Expand Up @@ -139,51 +137,16 @@ void BCMFASTPATH osl_pktfree(osl_t *osh, void *p, bool send)

u32 osl_pci_read_config(osl_t *osh, uint offset, uint size)
{
uint val = 0;
uint retry = PCI_CFG_RETRY;

ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC)));

/* only 4byte access supported */
ASSERT(size == 4);

do {
pci_read_config_dword(osh->pdev, offset, &val);
if (val != 0xffffffff)
break;
} while (retry--);

#ifdef BCMDBG
if (retry < PCI_CFG_RETRY)
printk("PCI CONFIG READ access to %d required %d retries\n",
offset, (PCI_CFG_RETRY - retry));
#endif /* BCMDBG */

uint val;
pci_read_config_dword(osh->pdev, offset, &val);
return val;
}

void osl_pci_write_config(osl_t *osh, uint offset, uint size, uint val)
{
uint retry = PCI_CFG_RETRY;

ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC)));

/* only 4byte access supported */
ASSERT(size == 4);

do {
pci_write_config_dword(osh->pdev, offset, val);
if (offset != PCI_BAR0_WIN)
break;
if (osl_pci_read_config(osh, offset, size) == val)
break;
} while (retry--);

#if defined(BCMDBG) && !defined(BRCM_FULLMAC)
if (retry < PCI_CFG_RETRY)
printk("PCI CONFIG WRITE access to %d required %d retries\n",
offset, (PCI_CFG_RETRY - retry));
#endif /* BCMDBG */
pci_write_config_dword(osh->pdev, offset, val);
if (offset == PCI_BAR0_WIN)
ASSERT(osl_pci_read_config(osh, offset, size) == val);
}

/* return bus # for the pci device pointed by osh->pdev */
Expand Down

0 comments on commit 86b93f8

Please sign in to comment.