/* osl handle type forward declaration */
struct osl_info {
uint pktalloced; /* Number of allocated packet buffers */
- bool mmbus; /* Bus supports memory-mapped registers */
uint magic;
- void *pdev;
- uint bustype;
};
typedef struct osl_dmainfo osldma_t;
u32 oob_router; /* oob router registers for axi */
} si_info_t;
-#define SI_INFO(sih) (si_info_t *)sih
+#define SI_INFO(sih) ((si_info_t *)(sih))
#define GOODCOREADDR(x, b) (((x) >= (b)) && ((x) < ((b) + SI_MAXCORES * SI_CORE_SIZE)) && \
IS_ALIGNED((x), SI_CORE_SIZE))
struct osl_info *osh; /* os handle */
void *pbus; /* bus handle */
- si_t *sih; /* sb handle */
bool dma64; /* this dma engine is operating in 64-bit mode */
bool addrext; /* this dma engine supports DmaExtendedAddrChanges */
di->name[MAXNAMEL - 1] = '\0';
di->osh = osh;
- di->sih = sih;
- di->pbus = osh->pdev;
+ di->pbus = ((struct si_info *)sih)->pbus;
/* save tunables */
di->ntxd = (u16) ntxd;
ASSERT(osh);
memset(osh, 0, sizeof(struct osl_info));
-
osh->magic = OS_HANDLE_MAGIC;
- osh->pdev = pdev;
- osh->bustype = bustype;
-
- switch (bustype) {
- case PCI_BUS:
- case SI_BUS:
- case PCMCIA_BUS:
- osh->mmbus = true;
- break;
- case JTAG_BUS:
- case SDIO_BUS:
- case USB_BUS:
- case SPI_BUS:
- case RPC_BUS:
- osh->mmbus = false;
- break;
- default:
- ASSERT(false);
- break;
- }
-
return osh;
}
kfree(osh);
}
-/* return bus # for the pci device pointed by osh->pdev */
-uint osl_pci_bus(struct osl_info *osh)
-{
- ASSERT(osh && (osh->magic == OS_HANDLE_MAGIC) && osh->pdev);
-
- return ((struct pci_dev *)osh->pdev)->bus->number;
-}
-
-/* return slot # for the pci device pointed by osh->pdev */
-uint osl_pci_slot(struct osl_info *osh)
-{
- ASSERT(osh && (osh->magic == OS_HANDLE_MAGIC) && osh->pdev);
-
- return PCI_SLOT(((struct pci_dev *)osh->pdev)->devfn);
-}
-
#if defined(BCMDBG_ASSERT)
void osl_assert(char *exp, char *file, int line)
{