Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: aacraid: Retrieve HBA host information ioctl

Added a new ioctl interface to retrieve the host device information.

Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Signed-off-by: Dave Carroll <David.Carroll@microsemi.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Raghava Aditya Renukunta and committed by
Martin K. Petersen
c799d519 09867a0e

+78
+52
drivers/scsi/aacraid/aacraid.h
··· 2334 2334 #define FSACTL_GET_CONTAINERS 2131 2335 2335 #define FSACTL_SEND_LARGE_FIB CTL_CODE(2138, METHOD_BUFFERED) 2336 2336 #define FSACTL_RESET_IOP CTL_CODE(2140, METHOD_BUFFERED) 2337 + #define FSACTL_GET_HBA_INFO CTL_CODE(2150, METHOD_BUFFERED) 2337 2338 /* flags defined for IOP & HW SOFT RESET */ 2338 2339 #define HW_IOP_RESET 0x01 2339 2340 #define HW_SOFT_RESET 0x02 ··· 2372 2371 }; 2373 2372 2374 2373 extern struct aac_common aac_config; 2374 + 2375 + /* 2376 + * This is for management ioctl purpose only. 2377 + */ 2378 + struct aac_hba_info { 2379 + 2380 + u8 driver_name[50]; 2381 + u8 adapter_number; 2382 + u8 system_io_bus_number; 2383 + u8 device_number; 2384 + u32 function_number; 2385 + u32 vendor_id; 2386 + u32 device_id; 2387 + u32 sub_vendor_id; 2388 + u32 sub_system_id; 2389 + u32 mapped_base_address_size; 2390 + u32 base_physical_address_high_part; 2391 + u32 base_physical_address_low_part; 2392 + 2393 + u32 max_command_size; 2394 + u32 max_fib_size; 2395 + u32 max_scatter_gather_from_os; 2396 + u32 max_scatter_gather_to_fw; 2397 + u32 max_outstanding_fibs; 2398 + 2399 + u32 queue_start_threshold; 2400 + u32 queue_dump_threshold; 2401 + u32 max_io_size_queued; 2402 + u32 outstanding_io; 2403 + 2404 + u32 firmware_build_number; 2405 + u32 bios_build_number; 2406 + u32 driver_build_number; 2407 + u32 serial_number_high_part; 2408 + u32 serial_number_low_part; 2409 + u32 supported_options; 2410 + u32 feature_bits; 2411 + u32 currentnumber_ports; 2412 + 2413 + u8 new_comm_interface:1; 2414 + u8 new_commands_supported:1; 2415 + u8 disable_passthrough:1; 2416 + u8 expose_non_dasd:1; 2417 + u8 queue_allowed:1; 2418 + u8 bled_check_enabled:1; 2419 + u8 reserved1:1; 2420 + u8 reserted2:1; 2421 + 2422 + u32 reserved3[10]; 2423 + 2424 + }; 2375 2425 2376 2426 /* 2377 2427 * The following macro is used when sending and receiving FIBs. It is
+26
drivers/scsi/aacraid/commctrl.c
··· 1011 1011 } 1012 1012 return 0; 1013 1013 } 1014 + 1015 + static int aac_get_hba_info(struct aac_dev *dev, void __user *arg) 1016 + { 1017 + struct aac_hba_info hbainfo; 1018 + 1019 + hbainfo.adapter_number = (u8) dev->id; 1020 + hbainfo.system_io_bus_number = dev->pdev->bus->number; 1021 + hbainfo.device_number = (dev->pdev->devfn >> 3); 1022 + hbainfo.function_number = (dev->pdev->devfn & 0x0007); 1023 + 1024 + hbainfo.vendor_id = dev->pdev->vendor; 1025 + hbainfo.device_id = dev->pdev->device; 1026 + hbainfo.sub_vendor_id = dev->pdev->subsystem_vendor; 1027 + hbainfo.sub_system_id = dev->pdev->subsystem_device; 1028 + 1029 + if (copy_to_user(arg, &hbainfo, sizeof(struct aac_hba_info))) { 1030 + dprintk((KERN_DEBUG "aacraid: Could not copy hba info\n")); 1031 + return -EFAULT; 1032 + } 1033 + 1034 + return 0; 1035 + } 1036 + 1014 1037 struct aac_reset_iop { 1015 1038 u8 reset_type; 1016 1039 }; ··· 1092 1069 break; 1093 1070 case FSACTL_GET_PCI_INFO: 1094 1071 status = aac_get_pci_info(dev,arg); 1072 + break; 1073 + case FSACTL_GET_HBA_INFO: 1074 + status = aac_get_hba_info(dev, arg); 1095 1075 break; 1096 1076 case FSACTL_RESET_IOP: 1097 1077 status = aac_send_reset_adapter(dev, arg);