mfivar.h (238373) | mfivar.h (242681) |
---|---|
1/*- 2 * Copyright (c) 2006 IronPort Systems 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 40 unchanged lines hidden (view full) --- 49 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 50 * SUCH DAMAGE. 51 */ 52 53#ifndef _MFIVAR_H 54#define _MFIVAR_H 55 56#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2006 IronPort Systems 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 40 unchanged lines hidden (view full) --- 49 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 50 * SUCH DAMAGE. 51 */ 52 53#ifndef _MFIVAR_H 54#define _MFIVAR_H 55 56#include <sys/cdefs.h> |
57__FBSDID("$FreeBSD: head/sys/dev/mfi/mfivar.h 238373 2012-07-11 19:08:23Z sbruno $"); | 57__FBSDID("$FreeBSD: head/sys/dev/mfi/mfivar.h 242681 2012-11-06 23:25:06Z ambrisko $"); |
58 59#include <sys/lock.h> 60#include <sys/sx.h> 61 62#include <sys/types.h> 63#include <sys/taskqueue.h> 64#include "opt_mfi.h" 65 --- 35 unchanged lines hidden (view full) --- 101#define MFI_CMD_DATAIN (1<<1) 102#define MFI_CMD_DATAOUT (1<<2) 103#define MFI_CMD_COMPLETED (1<<3) 104#define MFI_CMD_POLLED (1<<4) 105#define MFI_ON_MFIQ_FREE (1<<5) 106#define MFI_ON_MFIQ_READY (1<<6) 107#define MFI_ON_MFIQ_BUSY (1<<7) 108#define MFI_ON_MFIQ_MASK ((1<<5)|(1<<6)|(1<<7)) | 58 59#include <sys/lock.h> 60#include <sys/sx.h> 61 62#include <sys/types.h> 63#include <sys/taskqueue.h> 64#include "opt_mfi.h" 65 --- 35 unchanged lines hidden (view full) --- 101#define MFI_CMD_DATAIN (1<<1) 102#define MFI_CMD_DATAOUT (1<<2) 103#define MFI_CMD_COMPLETED (1<<3) 104#define MFI_CMD_POLLED (1<<4) 105#define MFI_ON_MFIQ_FREE (1<<5) 106#define MFI_ON_MFIQ_READY (1<<6) 107#define MFI_ON_MFIQ_BUSY (1<<7) 108#define MFI_ON_MFIQ_MASK ((1<<5)|(1<<6)|(1<<7)) |
109#define MFI_CMD_SCSI (1<<8) |
|
109 uint8_t retry_for_fw_reset; 110 void (* cm_complete)(struct mfi_command *cm); 111 void *cm_private; 112 int cm_index; 113 int cm_error; 114}; 115 116struct mfi_disk { --- 4 unchanged lines hidden (view full) --- 121 struct mfi_softc *ld_controller; 122 struct mfi_ld_info *ld_info; 123 struct disk *ld_disk; 124 int ld_flags; 125#define MFI_DISK_FLAGS_OPEN 0x01 126#define MFI_DISK_FLAGS_DISABLED 0x02 127}; 128 | 110 uint8_t retry_for_fw_reset; 111 void (* cm_complete)(struct mfi_command *cm); 112 void *cm_private; 113 int cm_index; 114 int cm_error; 115}; 116 117struct mfi_disk { --- 4 unchanged lines hidden (view full) --- 122 struct mfi_softc *ld_controller; 123 struct mfi_ld_info *ld_info; 124 struct disk *ld_disk; 125 int ld_flags; 126#define MFI_DISK_FLAGS_OPEN 0x01 127#define MFI_DISK_FLAGS_DISABLED 0x02 128}; 129 |
130struct mfi_disk_pending { 131 TAILQ_ENTRY(mfi_disk_pending) ld_link; 132 int ld_id; 133}; 134 |
|
129struct mfi_system_pd { 130 TAILQ_ENTRY(mfi_system_pd) pd_link; 131 device_t pd_dev; 132 int pd_id; 133 int pd_unit; 134 struct mfi_softc *pd_controller; 135 struct mfi_pd_info *pd_info; 136 struct disk *pd_disk; 137 int pd_flags; 138}; 139 | 135struct mfi_system_pd { 136 TAILQ_ENTRY(mfi_system_pd) pd_link; 137 device_t pd_dev; 138 int pd_id; 139 int pd_unit; 140 struct mfi_softc *pd_controller; 141 struct mfi_pd_info *pd_info; 142 struct disk *pd_disk; 143 int pd_flags; 144}; 145 |
146struct mfi_system_pending { 147 TAILQ_ENTRY(mfi_system_pending) pd_link; 148 int pd_id; 149}; 150 |
|
140struct mfi_evt_queue_elm { 141 TAILQ_ENTRY(mfi_evt_queue_elm) link; 142 struct mfi_evt_detail detail; 143}; 144 145struct mfi_aen { 146 TAILQ_ENTRY(mfi_aen) aen_link; 147 struct proc *p; --- 132 unchanged lines hidden (view full) --- 280 int mfi_sge_size; 281 /* 282 * Max number of sectors that the firmware allows 283 */ 284 uint32_t mfi_max_io; 285 286 TAILQ_HEAD(,mfi_disk) mfi_ld_tqh; 287 TAILQ_HEAD(,mfi_system_pd) mfi_syspd_tqh; | 151struct mfi_evt_queue_elm { 152 TAILQ_ENTRY(mfi_evt_queue_elm) link; 153 struct mfi_evt_detail detail; 154}; 155 156struct mfi_aen { 157 TAILQ_ENTRY(mfi_aen) aen_link; 158 struct proc *p; --- 132 unchanged lines hidden (view full) --- 291 int mfi_sge_size; 292 /* 293 * Max number of sectors that the firmware allows 294 */ 295 uint32_t mfi_max_io; 296 297 TAILQ_HEAD(,mfi_disk) mfi_ld_tqh; 298 TAILQ_HEAD(,mfi_system_pd) mfi_syspd_tqh; |
299 TAILQ_HEAD(,mfi_disk_pending) mfi_ld_pend_tqh; 300 TAILQ_HEAD(,mfi_system_pending) mfi_syspd_pend_tqh; |
|
288 eventhandler_tag mfi_eh; 289 struct cdev *mfi_cdev; 290 291 TAILQ_HEAD(, ccb_hdr) mfi_cam_ccbq; 292 struct mfi_command * (* mfi_cam_start)(void *); 293 struct callout mfi_watchdog_callout; 294 struct mtx mfi_io_lock; 295 struct sx mfi_config_lock; 296 297 /* Controller type specific interfaces */ 298 void (*mfi_enable_intr)(struct mfi_softc *sc); 299 void (*mfi_disable_intr)(struct mfi_softc *sc); 300 int32_t (*mfi_read_fw_status)(struct mfi_softc *sc); 301 int (*mfi_check_clear_intr)(struct mfi_softc *sc); 302 void (*mfi_issue_cmd)(struct mfi_softc *sc, bus_addr_t bus_add, 303 uint32_t frame_cnt); 304 int (*mfi_adp_reset)(struct mfi_softc *sc); 305 int (*mfi_adp_check_reset)(struct mfi_softc *sc); | 301 eventhandler_tag mfi_eh; 302 struct cdev *mfi_cdev; 303 304 TAILQ_HEAD(, ccb_hdr) mfi_cam_ccbq; 305 struct mfi_command * (* mfi_cam_start)(void *); 306 struct callout mfi_watchdog_callout; 307 struct mtx mfi_io_lock; 308 struct sx mfi_config_lock; 309 310 /* Controller type specific interfaces */ 311 void (*mfi_enable_intr)(struct mfi_softc *sc); 312 void (*mfi_disable_intr)(struct mfi_softc *sc); 313 int32_t (*mfi_read_fw_status)(struct mfi_softc *sc); 314 int (*mfi_check_clear_intr)(struct mfi_softc *sc); 315 void (*mfi_issue_cmd)(struct mfi_softc *sc, bus_addr_t bus_add, 316 uint32_t frame_cnt); 317 int (*mfi_adp_reset)(struct mfi_softc *sc); 318 int (*mfi_adp_check_reset)(struct mfi_softc *sc); |
319 void (*mfi_intr_ptr)(void *sc); |
|
306 307 /* ThunderBolt */ 308 uint32_t mfi_tbolt; 309 uint32_t MFA_enabled; 310 /* Single Reply structure size */ 311 uint16_t reply_size; 312 /* Singler message size. */ 313 uint16_t raid_io_msg_size; --- 102 unchanged lines hidden (view full) --- 416extern void mfi_intr_tbolt(void *arg); 417extern int mfi_tbolt_alloc_cmd(struct mfi_softc *sc); 418extern int mfi_tbolt_send_frame(struct mfi_softc *sc, struct mfi_command *cm); 419extern int mfi_tbolt_adp_reset(struct mfi_softc *sc); 420extern int mfi_tbolt_reset(struct mfi_softc *sc); 421extern void mfi_tbolt_sync_map_info(struct mfi_softc *sc); 422extern void mfi_handle_map_sync(void *context, int pending); 423extern int mfi_dcmd_command(struct mfi_softc *, struct mfi_command **, | 320 321 /* ThunderBolt */ 322 uint32_t mfi_tbolt; 323 uint32_t MFA_enabled; 324 /* Single Reply structure size */ 325 uint16_t reply_size; 326 /* Singler message size. */ 327 uint16_t raid_io_msg_size; --- 102 unchanged lines hidden (view full) --- 430extern void mfi_intr_tbolt(void *arg); 431extern int mfi_tbolt_alloc_cmd(struct mfi_softc *sc); 432extern int mfi_tbolt_send_frame(struct mfi_softc *sc, struct mfi_command *cm); 433extern int mfi_tbolt_adp_reset(struct mfi_softc *sc); 434extern int mfi_tbolt_reset(struct mfi_softc *sc); 435extern void mfi_tbolt_sync_map_info(struct mfi_softc *sc); 436extern void mfi_handle_map_sync(void *context, int pending); 437extern int mfi_dcmd_command(struct mfi_softc *, struct mfi_command **, |
424 uint32_t, void **, size_t); | 438 uint32_t, void **, size_t); 439extern int mfi_build_cdb(int, uint8_t, u_int64_t, u_int32_t, uint8_t *); |
425 426#define MFIQ_ADD(sc, qname) \ 427 do { \ 428 struct mfi_qstat *qs; \ 429 \ 430 qs = &(sc)->mfi_qstat[qname]; \ 431 qs->q_length++; \ 432 if (qs->q_length > qs->q_max) \ --- 173 unchanged lines hidden --- | 440 441#define MFIQ_ADD(sc, qname) \ 442 do { \ 443 struct mfi_qstat *qs; \ 444 \ 445 qs = &(sc)->mfi_qstat[qname]; \ 446 qs->q_length++; \ 447 if (qs->q_length > qs->q_max) \ --- 173 unchanged lines hidden --- |