aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/net/prism2_pci.c
blob: 52d06337ac73a1207f57cabf267db2e399e02de8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/**************************************************************************
Etherboot -  BOOTP/TFTP Bootstrap Program
Prism2 NIC driver for Etherboot
Wrapper for prism2_pci

Written by Michael Brown of Fen Systems Ltd
$Id$
***************************************************************************/

/*
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2, or (at
 * your option) any later version.
 */

#define WLAN_HOSTIF WLAN_PCI
#include "prism2.c"

static struct pci_id prism2_pci_nics[] = {
PCI_ROM(0x1260, 0x3873, "prism2_pci",	"Harris Semiconductor Prism2.5 clone"),
PCI_ROM(0x1260, 0x3873, "hwp01170",	"ActionTec HWP01170"),
PCI_ROM(0x1260, 0x3873, "dwl520",	"DLink DWL-520"),
};

static struct pci_driver prism2_pci_driver =
	PCI_DRIVER ( "Prism2_PCI", prism2_pci_nics, PCI_NO_CLASS );

static int prism2_pci_probe ( struct dev *dev, struct pci_device *pci ) {
  struct nic *nic = nic_device ( dev );
  hfa384x_t *hw = &hw_global;
  uint32_t membase = 0; /* Prism2.5 Memory Base */

  if ( ! find_pci_device ( pci, &prism2_pci_driver ) )
	  return 0;

  pci_read_config_dword( pci, PRISM2_PCI_MEM_BASE, &membase);
  membase &= PCI_BASE_ADDRESS_MEM_MASK;
  hw->membase = (uint32_t) phys_to_virt(membase);
  printf ( "Prism2.5 has registers at %#x\n", hw->membase );
  nic->ioaddr = hw->membase;

  return prism2_probe ( nic, hw );
}   

BOOT_DRIVER ( "Prism2_PCI", prism2_pci_probe );