Lines Matching refs:raid_dev

702 	mraid_device_t		*raid_dev;  in megaraid_init_mbox()  local
714 raid_dev = kzalloc(sizeof(mraid_device_t), GFP_KERNEL); in megaraid_init_mbox()
715 if (raid_dev == NULL) return -1; in megaraid_init_mbox()
721 adapter->raid_device = (caddr_t)raid_dev; in megaraid_init_mbox()
722 raid_dev->fast_load = megaraid_fast_load; in megaraid_init_mbox()
726 raid_dev->baseport = pci_resource_start(pdev, 0); in megaraid_init_mbox()
736 raid_dev->baseaddr = ioremap(raid_dev->baseport, 128); in megaraid_init_mbox()
738 if (!raid_dev->baseaddr) { in megaraid_init_mbox()
747 spin_lock_init(&raid_dev->mailbox_lock); in megaraid_init_mbox()
818 raid_dev->random_del_supported = 1; in megaraid_init_mbox()
898 iounmap(raid_dev->baseaddr); in megaraid_init_mbox()
902 kfree(raid_dev); in megaraid_init_mbox()
915 mraid_device_t *raid_dev = ADAP2RAIDDEV(adapter); in megaraid_fini_mbox() local
928 iounmap(raid_dev->baseaddr); in megaraid_fini_mbox()
932 kfree(raid_dev); in megaraid_fini_mbox()
950 mraid_device_t *raid_dev = ADAP2RAIDDEV(adapter); in megaraid_alloc_cmd_packets() local
967 raid_dev->una_mbox64 = dma_alloc_coherent(&adapter->pdev->dev, in megaraid_alloc_cmd_packets()
969 &raid_dev->una_mbox64_dma, in megaraid_alloc_cmd_packets()
972 if (!raid_dev->una_mbox64) { in megaraid_alloc_cmd_packets()
982 raid_dev->mbox = &raid_dev->una_mbox64->mbox32; in megaraid_alloc_cmd_packets()
984 raid_dev->mbox = (mbox_t *)((((unsigned long)raid_dev->mbox) + 15) & in megaraid_alloc_cmd_packets()
987 raid_dev->mbox64 = (mbox64_t *)(((unsigned long)raid_dev->mbox) - 8); in megaraid_alloc_cmd_packets()
989 align = ((void *)raid_dev->mbox - in megaraid_alloc_cmd_packets()
990 ((void *)&raid_dev->una_mbox64->mbox32)); in megaraid_alloc_cmd_packets()
992 raid_dev->mbox_dma = (unsigned long)raid_dev->una_mbox64_dma + 8 + in megaraid_alloc_cmd_packets()
1036 epthru_pci_blk = raid_dev->epthru_pool; in megaraid_alloc_cmd_packets()
1037 sg_pci_blk = raid_dev->sg_pool; in megaraid_alloc_cmd_packets()
1038 mbox_pci_blk = raid_dev->mbox_pool; in megaraid_alloc_cmd_packets()
1042 ccb = raid_dev->ccb_list + i; in megaraid_alloc_cmd_packets()
1095 (caddr_t)raid_dev->una_mbox64, raid_dev->una_mbox64_dma); in megaraid_alloc_cmd_packets()
1110 mraid_device_t *raid_dev = ADAP2RAIDDEV(adapter); in megaraid_free_cmd_packets() local
1120 (caddr_t)raid_dev->una_mbox64, raid_dev->una_mbox64_dma); in megaraid_free_cmd_packets()
1135 mraid_device_t *raid_dev = ADAP2RAIDDEV(adapter); in megaraid_mbox_setup_dma_pools() local
1144 raid_dev->mbox_pool_handle = dma_pool_create("megaraid mbox pool", in megaraid_mbox_setup_dma_pools()
1149 if (raid_dev->mbox_pool_handle == NULL) { in megaraid_mbox_setup_dma_pools()
1153 mbox_pci_blk = raid_dev->mbox_pool; in megaraid_mbox_setup_dma_pools()
1156 raid_dev->mbox_pool_handle, in megaraid_mbox_setup_dma_pools()
1172 raid_dev->epthru_pool_handle = dma_pool_create("megaraid mbox pthru", in megaraid_mbox_setup_dma_pools()
1175 if (raid_dev->epthru_pool_handle == NULL) { in megaraid_mbox_setup_dma_pools()
1179 epthru_pci_blk = raid_dev->epthru_pool; in megaraid_mbox_setup_dma_pools()
1182 raid_dev->epthru_pool_handle, in megaraid_mbox_setup_dma_pools()
1193 raid_dev->sg_pool_handle = dma_pool_create("megaraid mbox sg", in megaraid_mbox_setup_dma_pools()
1198 if (raid_dev->sg_pool_handle == NULL) { in megaraid_mbox_setup_dma_pools()
1202 sg_pci_blk = raid_dev->sg_pool; in megaraid_mbox_setup_dma_pools()
1205 raid_dev->sg_pool_handle, in megaraid_mbox_setup_dma_pools()
1231 mraid_device_t *raid_dev = ADAP2RAIDDEV(adapter); in megaraid_mbox_teardown_dma_pools() local
1238 sg_pci_blk = raid_dev->sg_pool; in megaraid_mbox_teardown_dma_pools()
1240 dma_pool_free(raid_dev->sg_pool_handle, sg_pci_blk[i].vaddr, in megaraid_mbox_teardown_dma_pools()
1243 dma_pool_destroy(raid_dev->sg_pool_handle); in megaraid_mbox_teardown_dma_pools()
1246 epthru_pci_blk = raid_dev->epthru_pool; in megaraid_mbox_teardown_dma_pools()
1248 dma_pool_free(raid_dev->epthru_pool_handle, in megaraid_mbox_teardown_dma_pools()
1251 dma_pool_destroy(raid_dev->epthru_pool_handle); in megaraid_mbox_teardown_dma_pools()
1254 mbox_pci_blk = raid_dev->mbox_pool; in megaraid_mbox_teardown_dma_pools()
1256 dma_pool_free(raid_dev->mbox_pool_handle, in megaraid_mbox_teardown_dma_pools()
1259 dma_pool_destroy(raid_dev->mbox_pool_handle); in megaraid_mbox_teardown_dma_pools()
1378 mraid_device_t *raid_dev = ADAP2RAIDDEV(adapter); in mbox_post_cmd() local
1387 mbox = raid_dev->mbox; in mbox_post_cmd()
1388 mbox64 = raid_dev->mbox64; in mbox_post_cmd()
1394 spin_lock_irqsave(MAILBOX_LOCK(raid_dev), flags); in mbox_post_cmd()
1405 spin_unlock_irqrestore(MAILBOX_LOCK(raid_dev), flags); in mbox_post_cmd()
1423 WRINDOOR(raid_dev, raid_dev->mbox_dma | 0x1); in mbox_post_cmd()
1425 spin_unlock_irqrestore(MAILBOX_LOCK(raid_dev), flags); in mbox_post_cmd()
2033 mraid_device_t *raid_dev = ADAP2RAIDDEV(adapter); in megaraid_ack_sequence() local
2045 mbox = raid_dev->mbox; in megaraid_ack_sequence()
2052 spin_lock_irqsave(MAILBOX_LOCK(raid_dev), flags); in megaraid_ack_sequence()
2058 dword = RDOUTDOOR(raid_dev); in megaraid_ack_sequence()
2063 WROUTDOOR(raid_dev, 0x10001234); in megaraid_ack_sequence()
2112 WRINDOOR(raid_dev, 0x02); in megaraid_ack_sequence()
2116 spin_unlock_irqrestore(MAILBOX_LOCK(raid_dev), flags); in megaraid_ack_sequence()
2172 mraid_device_t *raid_dev; in megaraid_mbox_dpc() local
2193 raid_dev = ADAP2RAIDDEV(adapter); in megaraid_mbox_dpc()
2256 && IS_RAID_CH(raid_dev, scb->dev_channel)) { in megaraid_mbox_dpc()
2272 raid_dev->pdrv_state[pdev_index] & 0x0F; in megaraid_mbox_dpc()
2380 mraid_device_t *raid_dev; in megaraid_abort_handler() local
2389 raid_dev = ADAP2RAIDDEV(adapter); in megaraid_abort_handler()
2397 if (raid_dev->hw_error) { in megaraid_abort_handler()
2520 mraid_device_t *raid_dev; in megaraid_reset_handler() local
2529 raid_dev = ADAP2RAIDDEV(adapter); in megaraid_reset_handler()
2532 if (raid_dev->hw_error) { in megaraid_reset_handler()
2613 raid_dev->hw_error = 1; in megaraid_reset_handler()
2668 mraid_device_t *raid_dev = ADAP2RAIDDEV(adapter); in mbox_post_sync_cmd() local
2673 mbox = raid_dev->mbox; in mbox_post_sync_cmd()
2678 if (megaraid_busywait_mbox(raid_dev) != 0) in mbox_post_sync_cmd()
2693 WRINDOOR(raid_dev, raid_dev->mbox_dma | 0x1); in mbox_post_sync_cmd()
2746 WRINDOOR(raid_dev, raid_dev->mbox_dma | 0x2); in mbox_post_sync_cmd()
2750 if (RDINDOOR(raid_dev) & 0x2) { in mbox_post_sync_cmd()
2753 for (i = 0; (RDINDOOR(raid_dev) & 0x2) && (i < 1000); i++) { in mbox_post_sync_cmd()
2798 mraid_device_t *raid_dev = ADAP2RAIDDEV(adapter); in mbox_post_sync_cmd_fast() local
2803 mbox = raid_dev->mbox; in mbox_post_sync_cmd_fast()
2818 WRINDOOR(raid_dev, raid_dev->mbox_dma | 0x1); in mbox_post_sync_cmd_fast()
2832 WRINDOOR(raid_dev, raid_dev->mbox_dma | 0x2); in mbox_post_sync_cmd_fast()
2847 megaraid_busywait_mbox(mraid_device_t *raid_dev) in megaraid_busywait_mbox() argument
2849 mbox_t *mbox = raid_dev->mbox; in megaraid_busywait_mbox()
2873 mraid_device_t *raid_dev = ADAP2RAIDDEV(adapter); in megaraid_mbox_product_info() local
2924 raid_dev->pdrv_state[i] = mraid_inq3->pdrv_state[i]; in megaraid_mbox_product_info()
3164 mraid_device_t *raid_dev = ADAP2RAIDDEV(adapter); in megaraid_mbox_enum_raid_scsi() local
3182 raid_dev->channel_class = 0xFF; in megaraid_mbox_enum_raid_scsi()
3184 raid_dev->channel_class = *(uint8_t *)adapter->ibuf; in megaraid_mbox_enum_raid_scsi()
3231 mraid_device_t *raid_dev = ADAP2RAIDDEV(adapter); in megaraid_mbox_fire_sync_cmd() local
3240 mbox = raid_dev->mbox; in megaraid_mbox_fire_sync_cmd()
3243 if (megaraid_busywait_mbox(raid_dev) != 0) { in megaraid_mbox_fire_sync_cmd()
3258 WRINDOOR(raid_dev, raid_dev->mbox_dma | 0x1); in megaraid_mbox_fire_sync_cmd()
3283 dword = RDOUTDOOR(raid_dev); in megaraid_mbox_fire_sync_cmd()
3284 WROUTDOOR(raid_dev, dword); in megaraid_mbox_fire_sync_cmd()
3285 WRINDOOR(raid_dev,2); in megaraid_mbox_fire_sync_cmd()
3395 mraid_device_t *raid_dev = ADAP2RAIDDEV(adapter); in megaraid_cmm_register() local
3428 ccb = raid_dev->uccb_list + i; in megaraid_cmm_register()
3431 ccb->mbox64 = raid_dev->umbox64 + i; in megaraid_cmm_register()
3760 mraid_device_t *raid_dev = ADAP2RAIDDEV(adapter); in megaraid_sysfs_alloc_resources() local
3763 raid_dev->sysfs_uioc = kmalloc(sizeof(uioc_t), GFP_KERNEL); in megaraid_sysfs_alloc_resources()
3765 raid_dev->sysfs_mbox64 = kmalloc(sizeof(mbox64_t), GFP_KERNEL); in megaraid_sysfs_alloc_resources()
3767 raid_dev->sysfs_buffer = dma_alloc_coherent(&adapter->pdev->dev, in megaraid_sysfs_alloc_resources()
3768 PAGE_SIZE, &raid_dev->sysfs_buffer_dma, GFP_KERNEL); in megaraid_sysfs_alloc_resources()
3770 if (!raid_dev->sysfs_uioc || !raid_dev->sysfs_mbox64 || in megaraid_sysfs_alloc_resources()
3771 !raid_dev->sysfs_buffer) { in megaraid_sysfs_alloc_resources()
3782 mutex_init(&raid_dev->sysfs_mtx); in megaraid_sysfs_alloc_resources()
3784 init_waitqueue_head(&raid_dev->sysfs_wait_q); in megaraid_sysfs_alloc_resources()
3799 mraid_device_t *raid_dev = ADAP2RAIDDEV(adapter); in megaraid_sysfs_free_resources() local
3801 kfree(raid_dev->sysfs_uioc); in megaraid_sysfs_free_resources()
3802 kfree(raid_dev->sysfs_mbox64); in megaraid_sysfs_free_resources()
3804 if (raid_dev->sysfs_buffer) { in megaraid_sysfs_free_resources()
3806 raid_dev->sysfs_buffer, raid_dev->sysfs_buffer_dma); in megaraid_sysfs_free_resources()
3821 mraid_device_t *raid_dev = ADAP2RAIDDEV(adapter); in megaraid_sysfs_get_ldmap_done() local
3825 wake_up(&raid_dev->sysfs_wait_q); in megaraid_sysfs_get_ldmap_done()
3842 mraid_device_t *raid_dev = ADAP2RAIDDEV(adapter); in megaraid_sysfs_get_ldmap_timeout() local
3846 wake_up(&raid_dev->sysfs_wait_q); in megaraid_sysfs_get_ldmap_timeout()
3870 mraid_device_t *raid_dev = ADAP2RAIDDEV(adapter); in megaraid_sysfs_get_ldmap() local
3882 mutex_lock(&raid_dev->sysfs_mtx); in megaraid_sysfs_get_ldmap()
3884 uioc = raid_dev->sysfs_uioc; in megaraid_sysfs_get_ldmap()
3885 mbox64 = raid_dev->sysfs_mbox64; in megaraid_sysfs_get_ldmap()
3886 ldmap = raid_dev->sysfs_buffer; in megaraid_sysfs_get_ldmap()
3890 memset(ldmap, 0, sizeof(raid_dev->curr_ldmap)); in megaraid_sysfs_get_ldmap()
3903 mbox->xferaddr = (uint32_t)raid_dev->sysfs_buffer_dma; in megaraid_sysfs_get_ldmap()
3924 wait_event(raid_dev->sysfs_wait_q, (uioc->status != -ENODATA)); in megaraid_sysfs_get_ldmap()
3940 memcpy(raid_dev->curr_ldmap, ldmap, in megaraid_sysfs_get_ldmap()
3941 sizeof(raid_dev->curr_ldmap)); in megaraid_sysfs_get_ldmap()
3957 mutex_unlock(&raid_dev->sysfs_mtx); in megaraid_sysfs_get_ldmap()
4006 mraid_device_t *raid_dev = ADAP2RAIDDEV(adapter); in megaraid_mbox_ld_show() local
4015 if (raid_dev->random_del_supported && in megaraid_mbox_ld_show()
4029 if (raid_dev->curr_ldmap[i] == mapped_sdev_id) { in megaraid_mbox_ld_show()
4035 ldid_map = raid_dev->curr_ldmap[i]; in megaraid_mbox_ld_show()