Skip to content

Commit

Permalink
iwx: rewrite device configuration, more like what linux iwlwifi do, t…
Browse files Browse the repository at this point in the history
…his is helpful for later 11ac support and gen3 devices support. correct wrong soc types value. remove unused fw_dma memory allocation.
  • Loading branch information
zxystd committed Feb 27, 2021
1 parent dbdbf00 commit b5c4e52
Show file tree
Hide file tree
Showing 3 changed files with 336 additions and 260 deletions.
32 changes: 30 additions & 2 deletions itl80211/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,15 @@ typedef struct bus_dmamap* bus_dmamap_t;
#define IWM_TX_RING_HIMARK 224

struct pci_matchid {
int pm_vid;
int pm_pid;
int pm_vid;
int pm_pid;
int pm_sub_dev;
int pm_sub_vid;
void *drv_data;
};

#define PCI_ANY_ID 0xffff

static inline int
pci_matchbyid(int vid, int pid, const struct pci_matchid *ids, int nent)
{
Expand All @@ -177,6 +182,29 @@ pci_matchbyid(int vid, int pid, const struct pci_matchid *ids, int nent)
return (0);
}

static inline int
pci_match(int vid, int pid, int sub_vid, int sub_dev, const struct pci_matchid *ids, int nent, void **drv_data)
{
const struct pci_matchid *pm;
int i;

for (i = 0, pm = ids; i < nent; i++, pm++) {
if (vid == pm->pm_vid && pid == pm->pm_pid) {
if (pm->pm_sub_dev != PCI_ANY_ID && sub_dev != pm->pm_sub_dev) {
return 0;
}
if (pm->pm_sub_vid != PCI_ANY_ID && sub_vid != pm->pm_sub_vid) {
return 0;
}
if (drv_data) {
*drv_data = pm->drv_data;
}
return 1;
}
}
return 0;
}

/*
* DMA glue is from iwn
*/
Expand Down
Loading

0 comments on commit b5c4e52

Please sign in to comment.