PXENV_UNDI_GET_NIC_TYPE
[PXE UNDI API]

UNDI GET NIC TYPE. More...


Data Structures

struct  pci_nic_info
 Information for a PCI or equivalent NIC. More...
struct  pnp_nic_info
 Information for an ISAPnP or equivalent NIC. More...
struct  s_PXENV_UNDI_GET_NIC_TYPE
 Parameter block for pxenv_undi_get_nic_type(). More...

Defines

#define PXENV_UNDI_GET_NIC_TYPE   0x0012
 PXE API function code for pxenv_undi_get_nic_type().
#define PCI_NIC   2
 PCI network card.
#define PnP_NIC   3
 ISAPnP network card.
#define CardBus_NIC   4
 CardBus network card.

Typedefs

typedef struct
s_PXENV_UNDI_GET_NIC_TYPE 
PXENV_UNDI_GET_NIC_TYPE_t

Functions

PXENV_EXIT_t pxenv_undi_get_nic_type (struct s_PXENV_UNDI_GET_NIC_TYPE *undi_get_nic_type)


Detailed Description

UNDI GET NIC TYPE.

Define Documentation

#define PXENV_UNDI_GET_NIC_TYPE   0x0012

PXE API function code for pxenv_undi_get_nic_type().

Definition at line 1380 of file pxe_api.h.

Referenced by pxe_api_call(), and pxeparent_function_name().

#define PCI_NIC   2

PCI network card.

Definition at line 1382 of file pxe_api.h.

Referenced by pxenv_undi_get_nic_type(), undirom_find_pci(), and undirom_parse_pcirheader().

#define PnP_NIC   3

ISAPnP network card.

Definition at line 1383 of file pxe_api.h.

Referenced by pxenv_undi_get_nic_type().

#define CardBus_NIC   4

CardBus network card.

Definition at line 1384 of file pxe_api.h.


Typedef Documentation

Definition at line 1428 of file pxe_api.h.


Function Documentation

PXENV_EXIT_t pxenv_undi_get_nic_type ( struct s_PXENV_UNDI_GET_NIC_TYPE undi_get_nic_type  ) 

Definition at line 541 of file pxe_undi.c.

References pnp_nic_info::Base_Class, pci_nic_info::Base_Class, device_description::bus_type, BUS_TYPE_ISAPNP, BUS_TYPE_PCI, pci_nic_info::BusDevFunc, pnp_nic_info::CardSelNum, device_description::class, DBG, device::desc, net_device::dev, pci_nic_info::Dev_ID, device_description::device, pnp_nic_info::EISA_Dev_ID, info, s_PXENV_UNDI_GET_NIC_TYPE::info, device_description::location, memset(), s_PXENV_UNDI_GET_NIC_TYPE::NicType, s_PXENV_UNDI_GET_NIC_TYPE::nic_type_info::pci, PCI_BASE_CLASS, PCI_BUS, PCI_FUNC, PCI_NIC, PCI_PROG_INTF, PCI_SLOT, PCI_SUB_CLASS, s_PXENV_UNDI_GET_NIC_TYPE::nic_type_info::pnp, PnP_NIC, pnp_nic_info::Prog_Intf, pci_nic_info::Prog_Intf, PXENV_EXIT_FAILURE, PXENV_EXIT_SUCCESS, PXENV_STATUS_FAILURE, PXENV_STATUS_SUCCESS, pci_nic_info::Rev, s_PXENV_UNDI_GET_NIC_TYPE::Status, pnp_nic_info::Sub_Class, pci_nic_info::Sub_Class, pci_nic_info::SubDevice_ID, pci_nic_info::SubVendor_ID, device_description::vendor, and pci_nic_info::Vendor_ID.

Referenced by pxe_api_call().

00542                                                             {
00543         struct device *dev = pxe_netdev->dev;
00544 
00545         DBG ( "PXENV_UNDI_GET_NIC_TYPE" );
00546 
00547         memset ( &undi_get_nic_type->info, 0,
00548                  sizeof ( undi_get_nic_type->info ) );
00549 
00550         switch ( dev->desc.bus_type ) {
00551         case BUS_TYPE_PCI: {
00552                 struct pci_nic_info *info = &undi_get_nic_type->info.pci;
00553 
00554                 undi_get_nic_type->NicType = PCI_NIC;
00555                 info->Vendor_ID = dev->desc.vendor;
00556                 info->Dev_ID = dev->desc.device;
00557                 info->Base_Class = PCI_BASE_CLASS ( dev->desc.class );
00558                 info->Sub_Class = PCI_SUB_CLASS ( dev->desc.class );
00559                 info->Prog_Intf = PCI_PROG_INTF ( dev->desc.class );
00560                 info->BusDevFunc = dev->desc.location;
00561                 /* Cheat: remaining fields are probably unnecessary,
00562                  * and would require adding extra code to pci.c.
00563                  */
00564                 undi_get_nic_type->info.pci.SubVendor_ID = 0xffff;
00565                 undi_get_nic_type->info.pci.SubDevice_ID = 0xffff;
00566                 DBG ( " PCI %02x:%02x.%x %04x:%04x (%04x:%04x) %02x%02x%02x "
00567                       "rev %02x\n", PCI_BUS ( info->BusDevFunc ),
00568                       PCI_SLOT ( info->BusDevFunc ),
00569                       PCI_FUNC ( info->BusDevFunc ), info->Vendor_ID,
00570                       info->Dev_ID, info->SubVendor_ID, info->SubDevice_ID,
00571                       info->Base_Class, info->Sub_Class, info->Prog_Intf,
00572                       info->Rev );
00573                 break; }
00574         case BUS_TYPE_ISAPNP: {
00575                 struct pnp_nic_info *info = &undi_get_nic_type->info.pnp;
00576 
00577                 undi_get_nic_type->NicType = PnP_NIC;
00578                 info->EISA_Dev_ID = ( ( dev->desc.vendor << 16 ) |
00579                                       dev->desc.device );
00580                 info->CardSelNum = dev->desc.location;
00581                 /* Cheat: remaining fields are probably unnecessary,
00582                  * and would require adding extra code to isapnp.c.
00583                  */
00584                 DBG ( " ISAPnP CSN %04x %08x %02x%02x%02x\n",
00585                       info->CardSelNum, info->EISA_Dev_ID,
00586                       info->Base_Class, info->Sub_Class, info->Prog_Intf );
00587                 break; }
00588         default:
00589                 DBG ( " failed: unknown bus type\n" );
00590                 undi_get_nic_type->Status = PXENV_STATUS_FAILURE;
00591                 return PXENV_EXIT_FAILURE;
00592         }
00593 
00594         undi_get_nic_type->Status = PXENV_STATUS_SUCCESS;
00595         return PXENV_EXIT_SUCCESS;
00596 }


Generated on Tue Apr 6 20:01:59 2010 for gPXE by  doxygen 1.5.7.1