struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle; 
struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle; 
static int hpc_get_cur_bus_speed (struct slot *slot, enum pci_bus_speed *value){	struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle;	enum pci_bus_speed bus_speed = PCI_SPEED_UNKNOWN;	u16 sec_bus_status;	int retval = 0;	u8 pi;	DBG_ENTER_ROUTINE 	if (!slot->ctrl->hpc_ctlr_handle) {		err("%s: Invalid HPC controller handle!\n", __FUNCTION__);		return -1;	}	if (slot->hp_slot >= php_ctlr->num_slots) {		err("%s: Invalid HPC slot number!\n", __FUNCTION__);		return -1;	}	pi = readb(php_ctlr->creg + PROG_INTERFACE);	sec_bus_status = readw(php_ctlr->creg + SEC_BUS_CONFIG);	if (pi == 2) {		switch (sec_bus_status & 0x000f) {		case 0:			bus_speed = PCI_SPEED_33MHz;			break;		case 1:			bus_speed = PCI_SPEED_66MHz;			break;		case 2:			bus_speed = PCI_SPEED_66MHz_PCIX;			break;		case 3:			bus_speed = PCI_SPEED_100MHz_PCIX;				break;		case 4:			bus_speed = PCI_SPEED_133MHz_PCIX;				break;		case 5:			bus_speed = PCI_SPEED_66MHz_PCIX_ECC;			break;		case 6:			bus_speed = PCI_SPEED_100MHz_PCIX_ECC;			break;		case 7:			bus_speed = PCI_SPEED_133MHz_PCIX_ECC;				break;		case 8:			bus_speed = PCI_SPEED_66MHz_PCIX_266;				break;		case 9:			bus_speed = PCI_SPEED_100MHz_PCIX_266;				break;		case 0xa:			bus_speed = PCI_SPEED_133MHz_PCIX_266;				break;		case 0xb:			bus_speed = PCI_SPEED_66MHz_PCIX_533;				break;		case 0xc:			bus_speed = PCI_SPEED_100MHz_PCIX_533;				break;		case 0xd:			bus_speed = PCI_SPEED_133MHz_PCIX_533;				break;		case 0xe:		case 0xf:		default:			bus_speed = PCI_SPEED_UNKNOWN;			break;		}	} else {		/* In the case where pi is undefined, default it to 1 */ 		switch (sec_bus_status & 0x0007) {		case 0:			bus_speed = PCI_SPEED_33MHz;			break;		case 1:			bus_speed = PCI_SPEED_66MHz;			break;		case 2:			bus_speed = PCI_SPEED_66MHz_PCIX;			break;		case 3:			bus_speed = PCI_SPEED_100MHz_PCIX;				break;		case 4:			bus_speed = PCI_SPEED_133MHz_PCIX;				break;		case 5:			bus_speed = PCI_SPEED_UNKNOWN;		/*	Reserved */			break;		case 6:			bus_speed = PCI_SPEED_UNKNOWN;		/*	Reserved */			break;		case 7:			bus_speed = PCI_SPEED_UNKNOWN;		/*	Reserved */				break;		default:			bus_speed = PCI_SPEED_UNKNOWN;			break;		}	}	*value = bus_speed;	dbg("Current bus speed = %d\n", bus_speed);	DBG_LEAVE_ROUTINE 	return retval;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/ee138334d5eb5ca662b2d69228420c1ccc051e0e/shpchp_hpc.c/buggy/drivers/pci/hotplug/shpchp_hpc.c