_PROTOTYPE( PRIVATE void do_watchdog, (void *); );
_PROTOTYPE( PRIVATE void de_update_conf, (dpeth_t *); );
-_PROTOTYPE( PRIVATE int de_probe, (dpeth_t *); );
+_PROTOTYPE( PRIVATE int de_probe, (dpeth_t *, int skip); );
_PROTOTYPE( PRIVATE void de_conf_addr, (dpeth_t *); );
_PROTOTYPE( PRIVATE void de_first_init, (dpeth_t *); );
_PROTOTYPE( PRIVATE void de_reset, (const dpeth_t *); );
if (dep->de_mode == DEM_DISABLED) {
de_update_conf(dep);
pci_init();
- if (dep->de_mode == DEM_ENABLED && !de_probe(dep)) {
+ if (dep->de_mode == DEM_ENABLED && !de_probe(dep, port)) {
printf("%s: warning no ethernet card found at 0x%04X\n",
dep->de_name, dep->de_base_port);
dep->de_mode = DEM_DISABLED;
return;
}
-PRIVATE int de_probe(dpeth_t *dep){
+PRIVATE int de_probe(dpeth_t *dep, int skip){
int i, r, devind;
u16_t vid, did, temp16;
{
if ( DEC21140A_VID == vid &&
DEC21140A_DID == did)
- break;
+ {
+ if (!skip)
+ break;
+ skip--;
+ }
r= pci_next_dev(&devind, &vid, &did);
if (!r)
{
continue;
}
- if (!rtl_probe(dep))
+ if (!rtl_probe(dep, i))
dep->de_pci= -1;
}
}
_PROTOTYPE( void ne_init, (struct dpeth *dep) );
/* rtl8029.c */
-_PROTOTYPE( int rtl_probe, (struct dpeth *dep) );
+_PROTOTYPE( int rtl_probe, (struct dpeth *dep, int skip) );
/* wdeth.c */
_PROTOTYPE( int wdeth_probe, (struct dpeth* dep) );
_PROTOTYPE( static void ee_wds, (dpeth_t *dep) );
#endif
-PUBLIC int rtl_probe(dep)
+PUBLIC int rtl_probe(dep, skip)
struct dpeth *dep;
+int skip;
{
int i, r, devind, just_one;
u16_t vid, did;
}
break;
}
- if (pcitab[i].vid != 0 || pcitab[i].did != 0)
- break;
+ if (pcitab[i].vid != 0 || pcitab[i].did != 0) {
+ if (just_one || !skip)
+ break;
+ skip--;
+ }
if (just_one)
{
_PROTOTYPE( PRIVATE void e1000_init, (message *mp) );
_PROTOTYPE( PRIVATE void e1000_init_pci, (void) );
-_PROTOTYPE( PRIVATE int e1000_probe, (e1000_t *e) );
+_PROTOTYPE( PRIVATE int e1000_probe, (e1000_t *e, int skip) );
_PROTOTYPE( PRIVATE int e1000_init_hw, (e1000_t *e) );
_PROTOTYPE( PRIVATE void e1000_init_addr, (e1000_t *e) );
_PROTOTYPE( PRIVATE void e1000_init_buf, (e1000_t *e) );
{
strcpy(e->name, "e1000#0");
e->name[6] += i;
- e1000_probe(e);
+ e1000_probe(e, i);
}
}
/*===========================================================================*
* e1000_probe *
*===========================================================================*/
-PRIVATE int e1000_probe(e1000_t *e)
+PRIVATE int e1000_probe(e1000_t *e, int skip)
{
int i, r, devind;
u16_t vid, did;
break;
}
if (pcitab_e1000[i] != 0)
- break;
+ {
+ if (!skip)
+ break;
+ skip--;
+ }
if (!(r = pci_next_dev(&devind, &vid, &did)))
{
_PROTOTYPE( static void fxp_init, (message *mp) );
_PROTOTYPE( static void fxp_pci_conf, (void) );
-_PROTOTYPE( static int fxp_probe, (fxp_t *fp) );
+_PROTOTYPE( static int fxp_probe, (fxp_t *fp, int skip) );
_PROTOTYPE( static void fxp_conf_hw, (fxp_t *fp) );
_PROTOTYPE( static void fxp_init_hw, (fxp_t *fp) );
_PROTOTYPE( static void fxp_init_buf, (fxp_t *fp) );
{
continue;
}
- if (fxp_probe(fp))
+ if (fxp_probe(fp, i))
fp->fxp_seen= TRUE;
}
}
/*===========================================================================*
* fxp_probe *
*===========================================================================*/
-static int fxp_probe(fxp_t *fp)
+static int fxp_probe(fxp_t *fp, int skip)
{
int i, r, devind, just_one;
u16_t vid, did;
break;
}
if (pcitab_fxp[i].vid != 0)
- break;
+ {
+ if (just_one || !skip)
+ break;
+ skip--;
+ }
if (just_one)
{
_PROTOTYPE( static void getAddressing, (int devind, ether_card_t *ec) );
/* probe+init LANCE cards */
-_PROTOTYPE( static int lance_probe, (ether_card_t *ec) );
+_PROTOTYPE( static int lance_probe, (ether_card_t *ec, int skip) );
_PROTOTYPE( static void lance_init_card, (ether_card_t *ec) );
/* Accesses Lance Control and Status Registers */
if (ec->mode != EC_ENABLED)
return;
- if (!lance_probe(ec))
+ if (!lance_probe(ec, ifnr))
{
printf("%s: No ethernet card found on PCI-BIOS info.\n",
ec->port_name);
/*===========================================================================*
* lance_probe *
*===========================================================================*/
-static int lance_probe(ec)
+static int lance_probe(ec, skip)
ether_card_t *ec;
+int skip;
{
unsigned short pci_cmd;
unsigned short ioaddr;
break;
}
if (pcitab[i].vid != 0)
- break;
+ {
+ if (just_one || !skip)
+ break;
+ skip--;
+ }
if (just_one)
{
_PROTOTYPE (static void or_writev_s, (message * mp, int from_int));
_PROTOTYPE (static void or_readv_s, (message * mp, int from_int));
_PROTOTYPE (static void reply, (t_or * orp, int err, int may_block));
-_PROTOTYPE (static int or_probe, (t_or *));
+_PROTOTYPE (static int or_probe, (t_or *, int skip));
_PROTOTYPE (static void or_ev_info, (t_or *));
_PROTOTYPE (static void or_init, (message *));
_PROTOTYPE (static void or_pci_conf, (void));
orp->or_pci_func) != 0) != h) {
continue;
}
- if (or_probe (orp))
+ if (or_probe (orp, i))
orp->or_seen = TRUE;
}
}
* Try to find the card based on information provided by pci and get irq and *
* bar *
*****************************************************************************/
-static int or_probe (t_or * orp)
+static int or_probe (t_or * orp, int skip)
{
u8_t ilr;
u32_t bar;
/* we have found the card in the pci bus */
break;
}
- if (pcitab[i].vid != 0)
- break;
+
+ /* unless we are looking for a specific device, we may have to
+ * skip a number of cards because they are already reserved for
+ * other (lower) ports of this driver */
+ if (pcitab[i].vid != 0) {
+ if (just_one || !skip)
+ break;
+ skip--;
+ }
if (just_one) {
printf ("%s: wrong PCI device", orp->or_name);
_PROTOTYPE( static void rl_init, (message *mp) );
_PROTOTYPE( static void rl_pci_conf, (void) );
-_PROTOTYPE( static int rl_probe, (re_t *rep) );
+_PROTOTYPE( static int rl_probe, (re_t *rep, int skip) );
_PROTOTYPE( static void rl_conf_hw, (re_t *rep) );
_PROTOTYPE( static void rl_init_buf, (re_t *rep) );
_PROTOTYPE( static void rl_init_hw, (re_t *rep) );
{
continue;
}
- if (rl_probe(rep))
+ if (rl_probe(rep, i))
rep->re_seen= TRUE;
}
}
/*===========================================================================*
* rl_probe *
*===========================================================================*/
-static int rl_probe(rep)
+static int rl_probe(rep, skip)
re_t *rep;
+int skip;
{
int i, r, devind, just_one;
u16_t vid, did;
break;
}
if (pcitab[i].vid != 0)
- break;
+ {
+ if (just_one || !skip)
+ break;
+ skip--;
+ }
if (just_one)
{
_PROTOTYPE( static void rl_init, (message *mp) );
_PROTOTYPE( static void rl_pci_conf, (void) );
-_PROTOTYPE( static int rl_probe, (re_t *rep) );
+_PROTOTYPE( static int rl_probe, (re_t *rep, int skip) );
_PROTOTYPE( static void rl_conf_hw, (re_t *rep) );
_PROTOTYPE( static void rl_init_buf, (re_t *rep) );
_PROTOTYPE( static void rl_init_hw, (re_t *rep) );
rep->re_pcifunc) != 0) != h) {
continue;
}
- if (rl_probe(rep))
+ if (rl_probe(rep, i))
rep->re_seen = TRUE;
}
}
/*===========================================================================*
* rl_probe *
*===========================================================================*/
-static int rl_probe(rep)
+static int rl_probe(rep, skip)
re_t *rep;
+int skip;
{
int i, r, devind, just_one;
u16_t vid, did;
}
break;
}
- if (pcitab[i].vid != 0)
- break;
+ if (pcitab[i].vid != 0) {
+ if (just_one || !skip)
+ break;
+ skip--;
+ }
if (just_one) {
printf("%s: wrong PCI device (%04x/%04x) found at %d.%d.%d\n",