Lines Matching refs:pDev

192 	struct pci_dev *pDev = NULL;  in adpt_detect()  local
199 while ((pDev = pci_get_device( PCI_DPT_VENDOR_ID, PCI_ANY_ID, pDev))) { in adpt_detect()
200 if(pDev->device == PCI_DPT_DEVICE_ID || in adpt_detect()
201 pDev->device == PCI_DPT_RAPTOR_DEVICE_ID){ in adpt_detect()
202 if(adpt_install_hba(sht, pDev) ){ in adpt_detect()
207 pci_dev_get(pDev); in adpt_detect()
328 buf = dma_alloc_coherent(&pHba->pDev->dev, 80, &addr, GFP_KERNEL); in adpt_inquiry()
392 dma_free_coherent(&pHba->pDev->dev, 80, buf, addr); in adpt_inquiry()
401 dma_free_coherent(&pHba->pDev->dev, 80, buf, addr); in adpt_inquiry()
422 struct adpt_device* pDev = NULL; /* dpt per device information */ in adpt_queue_lck() local
449 if((pDev = (struct adpt_device*) (cmd->device->hostdata)) == NULL) { in adpt_queue_lck()
455 …if ((pDev = adpt_find_device(pHba, (u32)cmd->device->channel, (u32)cmd->device->id, cmd->device->l… in adpt_queue_lck()
462 cmd->device->hostdata = pDev; in adpt_queue_lck()
464 pDev->pScsi_dev = cmd->device; in adpt_queue_lck()
470 if (pDev->state & DPTI_DEV_RESET ) { in adpt_queue_lck()
473 return adpt_scsi_to_i2o(pHba, cmd, pDev); in adpt_queue_lck()
859 static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev) in adpt_install_hba() argument
874 if(pci_enable_device(pDev)) { in adpt_install_hba()
878 if (pci_request_regions(pDev, "dpt_i2o")) { in adpt_install_hba()
883 pci_set_master(pDev); in adpt_install_hba()
889 dma_get_required_mask(&pDev->dev) > DMA_BIT_MASK(32) && in adpt_install_hba()
890 dma_set_mask(&pDev->dev, DMA_BIT_MASK(64)) == 0) in adpt_install_hba()
893 if (!dma64 && dma_set_mask(&pDev->dev, DMA_BIT_MASK(32)) != 0) in adpt_install_hba()
897 dma_set_coherent_mask(&pDev->dev, DMA_BIT_MASK(32)); in adpt_install_hba()
899 base_addr0_phys = pci_resource_start(pDev,0); in adpt_install_hba()
900 hba_map0_area_size = pci_resource_len(pDev,0); in adpt_install_hba()
903 if(pDev->device == PCI_DPT_DEVICE_ID){ in adpt_install_hba()
904 if(pDev->subsystem_device >=0xc032 && pDev->subsystem_device <= 0xc03b){ in adpt_install_hba()
914 base_addr1_phys = pci_resource_start(pDev,1); in adpt_install_hba()
915 hba_map1_area_size = pci_resource_len(pDev,1); in adpt_install_hba()
940 pci_release_regions(pDev); in adpt_install_hba()
950 pci_release_regions(pDev); in adpt_install_hba()
963 pci_release_regions(pDev); in adpt_install_hba()
982 pHba->pDev = pDev; in adpt_install_hba()
998 pHba->pDev = pDev; in adpt_install_hba()
1010 hba_map0_area_size, pDev->irq, in adpt_install_hba()
1014 hba_count-1, pDev->irq, in adpt_install_hba()
1020 if (request_irq (pDev->irq, adpt_isr, IRQF_SHARED, pHba->name, pHba)) { in adpt_install_hba()
1021 printk(KERN_ERR"%s: Couldn't register IRQ %d\n", pHba->name, pDev->irq); in adpt_install_hba()
1038 struct adpt_device* pDev; in adpt_i2o_delete_hba() local
1062 pci_release_regions(pHba->pDev); in adpt_i2o_delete_hba()
1069 dma_free_coherent(&pHba->pDev->dev, in adpt_i2o_delete_hba()
1074 dma_free_coherent(&pHba->pDev->dev, pHba->lct_size, in adpt_i2o_delete_hba()
1078 dma_free_coherent(&pHba->pDev->dev, sizeof(i2o_status_block), in adpt_i2o_delete_hba()
1082 dma_free_coherent(&pHba->pDev->dev, in adpt_i2o_delete_hba()
1094 for(pDev = pHba->channel[i].device[j]; pDev; pDev = pNext){ in adpt_i2o_delete_hba()
1095 pNext = pDev->next_lun; in adpt_i2o_delete_hba()
1096 kfree(pDev); in adpt_i2o_delete_hba()
1101 pci_dev_put(pHba->pDev); in adpt_i2o_delete_hba()
1325 status = dma_alloc_coherent(&pHba->pDev->dev, 4, &addr, GFP_KERNEL); in adpt_i2o_reset_hba()
1391 dma_free_coherent(&pHba->pDev->dev, 4, status, addr); in adpt_i2o_reset_hba()
1412 struct adpt_device* pDev; in adpt_i2o_parse_lct() local
1527 pDev = kzalloc(sizeof(struct adpt_device),GFP_KERNEL); in adpt_i2o_parse_lct()
1528 if(pDev == NULL) { in adpt_i2o_parse_lct()
1531 pHba->channel[bus_no].device[scsi_id] = pDev; in adpt_i2o_parse_lct()
1533 for( pDev = pHba->channel[bus_no].device[scsi_id]; in adpt_i2o_parse_lct()
1534 pDev->next_lun; pDev = pDev->next_lun){ in adpt_i2o_parse_lct()
1536 pDev->next_lun = kzalloc(sizeof(struct adpt_device),GFP_KERNEL); in adpt_i2o_parse_lct()
1537 if(pDev->next_lun == NULL) { in adpt_i2o_parse_lct()
1540 pDev = pDev->next_lun; in adpt_i2o_parse_lct()
1542 pDev->tid = tid; in adpt_i2o_parse_lct()
1543 pDev->scsi_channel = bus_no; in adpt_i2o_parse_lct()
1544 pDev->scsi_id = scsi_id; in adpt_i2o_parse_lct()
1545 pDev->scsi_lun = scsi_lun; in adpt_i2o_parse_lct()
1546 pDev->pI2o_dev = d; in adpt_i2o_parse_lct()
1547 d->owner = pDev; in adpt_i2o_parse_lct()
1548 pDev->type = (buf[0])&0xff; in adpt_i2o_parse_lct()
1549 pDev->flags = (buf[0]>>8)&0xff; in adpt_i2o_parse_lct()
1731 p = dma_alloc_coherent(&pHba->pDev->dev, sg_size, &addr, GFP_KERNEL); in adpt_i2o_passthru()
1839 dma_free_coherent(&pHba->pDev->dev, in adpt_i2o_passthru()
1992 HbaInfo.pciBusNum = pHba->pDev->bus->number; in adpt_ioctl()
1993 HbaInfo.pciDeviceNum=PCI_SLOT(pHba->pDev->devfn); in adpt_ioctl()
1994 HbaInfo.Interrupt = pHba->pDev->irq; in adpt_ioctl()
2320 host->irq = pHba->pDev->irq; in adpt_scsi_host_alloc()
2489 struct adpt_device* pDev = NULL; in adpt_i2o_reparse_lct() local
2503 pDev =(struct adpt_device*) d->owner; in adpt_i2o_reparse_lct()
2504 if(!pDev){ in adpt_i2o_reparse_lct()
2507 pDev->state |= DPTI_DEV_UNSCANNED; in adpt_i2o_reparse_lct()
2535 pDev = pHba->channel[bus_no].device[scsi_id]; in adpt_i2o_reparse_lct()
2537 while(pDev) { in adpt_i2o_reparse_lct()
2538 if(pDev->scsi_lun == scsi_lun) { in adpt_i2o_reparse_lct()
2541 pDev = pDev->next_lun; in adpt_i2o_reparse_lct()
2543 if(!pDev ) { // Something new add it in adpt_i2o_reparse_lct()
2561 pDev = pHba->channel[bus_no].device[scsi_id]; in adpt_i2o_reparse_lct()
2562 if( pDev == NULL){ in adpt_i2o_reparse_lct()
2563 pDev = in adpt_i2o_reparse_lct()
2566 if(pDev == NULL) { in adpt_i2o_reparse_lct()
2569 pHba->channel[bus_no].device[scsi_id] = pDev; in adpt_i2o_reparse_lct()
2571 while (pDev->next_lun) { in adpt_i2o_reparse_lct()
2572 pDev = pDev->next_lun; in adpt_i2o_reparse_lct()
2574 pDev = pDev->next_lun = in adpt_i2o_reparse_lct()
2577 if(pDev == NULL) { in adpt_i2o_reparse_lct()
2581 pDev->tid = d->lct_data.tid; in adpt_i2o_reparse_lct()
2582 pDev->scsi_channel = bus_no; in adpt_i2o_reparse_lct()
2583 pDev->scsi_id = scsi_id; in adpt_i2o_reparse_lct()
2584 pDev->scsi_lun = scsi_lun; in adpt_i2o_reparse_lct()
2585 pDev->pI2o_dev = d; in adpt_i2o_reparse_lct()
2586 d->owner = pDev; in adpt_i2o_reparse_lct()
2587 pDev->type = (buf[0])&0xff; in adpt_i2o_reparse_lct()
2588 pDev->flags = (buf[0]>>8)&0xff; in adpt_i2o_reparse_lct()
2600 while(pDev) { in adpt_i2o_reparse_lct()
2601 if(pDev->scsi_lun == scsi_lun) { in adpt_i2o_reparse_lct()
2602 if(!scsi_device_online(pDev->pScsi_dev)) { in adpt_i2o_reparse_lct()
2605 if (pDev->pScsi_dev) { in adpt_i2o_reparse_lct()
2606 scsi_device_set_state(pDev->pScsi_dev, SDEV_RUNNING); in adpt_i2o_reparse_lct()
2609 d = pDev->pI2o_dev; in adpt_i2o_reparse_lct()
2611 pDev->tid = tid; in adpt_i2o_reparse_lct()
2613 if (pDev->pScsi_dev) { in adpt_i2o_reparse_lct()
2614 pDev->pScsi_dev->changed = TRUE; in adpt_i2o_reparse_lct()
2615 pDev->pScsi_dev->removable = TRUE; in adpt_i2o_reparse_lct()
2619 pDev->state = DPTI_DEV_ONLINE; in adpt_i2o_reparse_lct()
2622 pDev = pDev->next_lun; in adpt_i2o_reparse_lct()
2627 pDev =(struct adpt_device*) pI2o_dev->owner; in adpt_i2o_reparse_lct()
2628 if(!pDev){ in adpt_i2o_reparse_lct()
2633 if (pDev->state & DPTI_DEV_UNSCANNED){ in adpt_i2o_reparse_lct()
2634 pDev->state = DPTI_DEV_OFFLINE; in adpt_i2o_reparse_lct()
2635 …ERN_WARNING"%s: Device (%d,%d,%llu) offline\n",pHba->name,pDev->scsi_channel,pDev->scsi_id,pDev->s… in adpt_i2o_reparse_lct()
2636 if (pDev->pScsi_dev) { in adpt_i2o_reparse_lct()
2637 scsi_device_set_state(pDev->pScsi_dev, SDEV_OFFLINE); in adpt_i2o_reparse_lct()
2776 status = dma_alloc_coherent(&pHba->pDev->dev, 4, &addr, GFP_KERNEL); in adpt_i2o_init_outbound_q()
2818 dma_free_coherent(&pHba->pDev->dev, 4, status, addr); in adpt_i2o_init_outbound_q()
2821 dma_free_coherent(&pHba->pDev->dev, 4, status, addr); in adpt_i2o_init_outbound_q()
2824 dma_free_coherent(&pHba->pDev->dev, in adpt_i2o_init_outbound_q()
2829 pHba->reply_pool = dma_alloc_coherent(&pHba->pDev->dev, in adpt_i2o_init_outbound_q()
2866 pHba->status_block = dma_alloc_coherent(&pHba->pDev->dev, in adpt_i2o_status_get()
2993 pHba->lct = dma_alloc_coherent(&pHba->pDev->dev, in adpt_i2o_lct_get()
3022 dma_free_coherent(&pHba->pDev->dev, pHba->lct_size, in adpt_i2o_lct_get()
3058 dma_free_coherent(&pHba->pDev->dev, sys_tbl_len, in adpt_i2o_build_sys_table()
3064 sys_tbl = dma_alloc_coherent(&pHba->pDev->dev, in adpt_i2o_build_sys_table()
3230 pHba->hrt = dma_alloc_coherent(&pHba->pDev->dev, in adpt_i2o_hrt_get()
3252 dma_free_coherent(&pHba->pDev->dev, size, in adpt_i2o_hrt_get()
3276 resblk_va = dma_alloc_coherent(&pHba->pDev->dev, in adpt_i2o_query_scalar()
3283 opblk_va = dma_alloc_coherent(&pHba->pDev->dev, in adpt_i2o_query_scalar()
3286 dma_free_coherent(&pHba->pDev->dev, sizeof(u8) * (8+buflen), in adpt_i2o_query_scalar()
3299 dma_free_coherent(&pHba->pDev->dev, sizeof(opblk), opblk_va, opblk_pa); in adpt_i2o_query_scalar()
3301 dma_free_coherent(&pHba->pDev->dev, sizeof(u8) * (8+buflen), in adpt_i2o_query_scalar()
3306 dma_free_coherent(&pHba->pDev->dev, sizeof(u8) * (8+buflen), in adpt_i2o_query_scalar()
3314 dma_free_coherent(&pHba->pDev->dev, sizeof(u8) * (8+buflen), in adpt_i2o_query_scalar()
3522 error = scsi_add_host(pHba->host, &pHba->pDev->dev); in adpt_init()