aboutsummaryrefslogtreecommitdiff
path: root/drivers/message/fusion/mptsas.h
AgeCommit message (Collapse)AuthorFilesLines
2020-03-26scsi: message: fusion: Replace zero-length array with flexible-array memberGustavo A. R. Silva1-1/+1
The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2014-07-25mptfusion: combine fw_event_work and its event_dataJoe Lawrence1-1/+1
Tack the firmware reply event_data payload to the end of its corresponding struct fw_event_work allocation. Rework fw_event_work allocation calculations to include the event_data size where appropriate. This clarifies the code a bit and avoids the following smatch warnings: drivers/message/fusion/mptsas.c:1003 mptsas_queue_device_delete() error: memcpy() 'fw_event->event_data' too small (29 vs 36) drivers/message/fusion/mptsas.c:1017 mptsas_queue_rescan() error: not allocating enough data 168 vs 160 Signed-off-by: Joe Lawrence <[email protected]> Acked-by: Sreekanth Reddy <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2010-07-27[SCSI] mptfusion: Added sanity to check B_T mapping for device before adding ↵Kashyap, Desai1-0/+1
to OS Added sanity check before treating any device is a valid device. It is possible that firmware can have device page0 in its table, but that devicemay not be available in topology. Device will be available in topology only if there is Bus Target mapping is done in firmware. Driver will always check B_T mapping of firmware before reporting device to upper layer. Signed-off-by: Kashyap Desai <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2010-04-11[SCSI] mptfusion: Event data alignment with 4 byte.Kashyap, Desai1-1/+1
event_data needs to be 4 byte aligned to makes sure there is no unaligned memory access take place. Signed-off-by: Kashyap Desai <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2009-06-09[SCSI] mpt fusion: Queue full event handlingKashyap, Desai1-0/+6
FW will report Queue full event to Driver and driver will handle this queue full event to SCSI Mid layer. Signed-off-by: Kashyap Desai <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2009-06-09[SCSI] mpt fusion: RAID device handling and Dual port Raid support is addedKashyap, Desai1-0/+1
1. Handle integrated Raid device(Add/Delete) and error condition and check related to Raid device. is_logical_volume will represent logical volume device. 2. Raid device dual port support is added. Main functions to support this feature are mpt_raid_phys_disk_get_num_paths and mpt_raid_phys_disk_pg1. Signed-off-by: Kashyap Desai <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2009-06-09[SCSI] mpt fusion: Firmware event implementation using seperate WorkQueueKashyap, Desai1-4/+29
Now Firmware events are handled by firmware event queue. Previously it was handled in interrupt context/WorkQueue of Linux. Firmware Event handling is restructured and optimized. Signed-off-by: Kashyap Desai <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2009-06-09[SCSI] mpt fusion: Adding DeviceResetCtx for internal Device reset frameKashyap, Desai1-0/+1
1.) Added taskmgmt_quiesce_io flag in IOC and removed resetPending from _MPT_SCSI_HOST struct. 2.) Reset from Scsi mid layer and internal Reset are seperate context. Adding DeviceResetCtx for internal Device reset frame. mptsas_taskmgmt_complete is optimized as part of implementation. Signed-off-by: Kashyap Desai <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2008-06-05[SCSI] mpt fusion : Updated copyright statment with 2008 includedPrakash, Sathya1-1/+1
Updating copyright statement to include the year 2008 Signed-off-by: Sathya Prakash <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2007-10-12[SCSI] mpt fusion: Creation of mptsas.h header filePrakash, Sathya1-0/+158
The data structure definitions from mptsas.c are moved to a new header file mptsas.h signed-off-by: Sathya Prakash <[email protected]> Acked-by: Eric Moore <[email protected]> Signed-off-by: James Bottomley <[email protected]>