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_adapter_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;	u32 slot_reg;	u16 slot_status, sec_bus_status;	u8 m66_cap, pcix_cap, pi;	int retval = 0;	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);	slot_reg = readl(php_ctlr->creg + SLOT1 + 4*(slot->hp_slot));	dbg("%s: pi = %d, slot_reg = %x\n", __FUNCTION__, pi, slot_reg);	slot_status = (u16) slot_reg;	dbg("%s: slot_status = %x\n", __FUNCTION__, slot_status);	sec_bus_status = readw(php_ctlr->creg + SEC_BUS_CONFIG);	pcix_cap = (u8) ((slot_status & 0x3000) >> 12);	dbg("%s:  pcix_cap = %x\n", __FUNCTION__, pcix_cap);	m66_cap = (u8) ((slot_status & 0x0200) >> 9);	dbg("%s:  m66_cap = %x\n", __FUNCTION__, m66_cap);	if (pi == 2) {		switch (pcix_cap) {		case 0:			*value = m66_cap ? PCI_SPEED_66MHz : PCI_SPEED_33MHz;			break;		case 1:			*value = PCI_SPEED_66MHz_PCIX;			break;		case 3:			*value = PCI_SPEED_133MHz_PCIX;			break;		case 4:			*value = PCI_SPEED_133MHz_PCIX_266;				break;		case 5:			*value = PCI_SPEED_133MHz_PCIX_533;				break;		case 2:	/* Reserved */		default:			*value = PCI_SPEED_UNKNOWN;			retval = -ENODEV;			break;		}	} else {		switch (pcix_cap) {		case 0:			*value = m66_cap ? PCI_SPEED_66MHz : PCI_SPEED_33MHz;			break;		case 1:			*value = PCI_SPEED_66MHz_PCIX;			break;		case 3:			*value = PCI_SPEED_133MHz_PCIX;				break;		case 2:	/* Reserved */		default:			*value = PCI_SPEED_UNKNOWN;			retval = -ENODEV;			break;		}	}	dbg("Adapter speed = %d\n", *value);		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