aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/twa
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2020-09-01 21:29:23 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2020-09-01 21:29:23 +0000
commitbed02296486703b962e60a790842e5628d289d25 (patch)
treef4b169f3045cd1f27e0c1bb430b5e6404e08658a /sys/dev/twa
parentb138e49c66e80c8f467872c365ecc0b6dd8acaae (diff)
Notes
Diffstat (limited to 'sys/dev/twa')
-rw-r--r--sys/dev/twa/tw_cl.h25
-rw-r--r--sys/dev/twa/tw_cl_externs.h13
-rw-r--r--sys/dev/twa/tw_cl_fwif.h33
-rw-r--r--sys/dev/twa/tw_cl_init.c16
-rw-r--r--sys/dev/twa/tw_cl_intr.c38
-rw-r--r--sys/dev/twa/tw_cl_io.c38
-rw-r--r--sys/dev/twa/tw_cl_ioctl.h10
-rw-r--r--sys/dev/twa/tw_cl_misc.c43
-rw-r--r--sys/dev/twa/tw_cl_share.h70
-rw-r--r--sys/dev/twa/tw_osl.h28
-rw-r--r--sys/dev/twa/tw_osl_cam.c25
-rw-r--r--sys/dev/twa/tw_osl_externs.h10
-rw-r--r--sys/dev/twa/tw_osl_freebsd.c58
-rw-r--r--sys/dev/twa/tw_osl_includes.h6
-rw-r--r--sys/dev/twa/tw_osl_inline.h42
-rw-r--r--sys/dev/twa/tw_osl_ioctl.h10
-rw-r--r--sys/dev/twa/tw_osl_share.h8
-rw-r--r--sys/dev/twa/tw_osl_types.h6
18 files changed, 7 insertions, 472 deletions
diff --git a/sys/dev/twa/tw_cl.h b/sys/dev/twa/tw_cl.h
index 82aba006ea7e3..8f047329c318a 100644
--- a/sys/dev/twa/tw_cl.h
+++ b/sys/dev/twa/tw_cl.h
@@ -36,18 +36,14 @@
* Modifications by: Adam Radford
*/
-
-
#ifndef TW_CL_H
#define TW_CL_H
-
/*
* Common Layer internal macros, structures and functions.
*/
-
#define TW_CLI_SECTOR_SIZE 0x200
#define TW_CLI_REQUEST_TIMEOUT_PERIOD 60 /* seconds */
#define TW_CLI_RESET_TIMEOUT_PERIOD 60 /* seconds */
@@ -76,7 +72,6 @@
#define TW_CLI_PCI_CONFIG_STATUS_OFFSET 0x6 /* status register offset */
#endif /* TW_OSL_PCI_CONFIG_ACCESSIBLE */
-
#ifdef TW_OSL_DEBUG
struct tw_cli_q_stats {
TW_UINT32 cur_len;/* current # of entries in q */
@@ -84,7 +79,6 @@ struct tw_cli_q_stats {
};
#endif /* TW_OSL_DEBUG */
-
/* Queues of CL internal request context packets. */
#define TW_CLI_FREE_Q 0 /* free q */
#define TW_CLI_BUSY_Q 1 /* q of reqs submitted to fw */
@@ -93,7 +87,6 @@ struct tw_cli_q_stats {
#define TW_CLI_RESET_Q 4 /* q of reqs reset by timeout */
#define TW_CLI_Q_COUNT 5 /* total number of queues */
-
/* CL's internal request context. */
struct tw_cli_req_context {
struct tw_cl_req_handle *req_handle;/* handle to track requests between
@@ -119,7 +112,6 @@ struct tw_cli_req_context {
struct tw_cl_link link; /* to link this request in a list */
};
-
/* CL's internal controller context. */
struct tw_cli_ctlr_context {
struct tw_cl_ctlr_handle *ctlr_handle; /* handle to track ctlr between
@@ -209,8 +201,6 @@ struct tw_cli_ctlr_context {
#endif /* TW_OSL_DEBUG */
};
-
-
/*
* Queue primitives
*/
@@ -222,7 +212,6 @@ struct tw_cli_ctlr_context {
(ctlr)->q_stats[q_type].max_len = 0; \
} while (0)
-
#define TW_CLI_Q_INSERT(ctlr, q_type) do { \
struct tw_cli_q_stats *q_stats = &((ctlr)->q_stats[q_type]); \
\
@@ -230,7 +219,6 @@ struct tw_cli_ctlr_context {
q_stats->max_len = q_stats->cur_len; \
} while (0)
-
#define TW_CLI_Q_REMOVE(ctlr, q_type) \
(ctlr)->q_stats[q_type].cur_len--
@@ -242,7 +230,6 @@ struct tw_cli_ctlr_context {
#endif /* TW_OSL_DEBUG */
-
/* Initialize a queue of requests. */
static __inline TW_VOID
tw_cli_req_q_init(struct tw_cli_ctlr_context *ctlr, TW_UINT8 q_type)
@@ -251,8 +238,6 @@ tw_cli_req_q_init(struct tw_cli_ctlr_context *ctlr, TW_UINT8 q_type)
TW_CLI_Q_INIT(ctlr, q_type);
}
-
-
/* Insert the given request at the head of the given queue (q_type). */
static __inline TW_VOID
tw_cli_req_q_insert_head(struct tw_cli_req_context *req, TW_UINT8 q_type)
@@ -265,8 +250,6 @@ tw_cli_req_q_insert_head(struct tw_cli_req_context *req, TW_UINT8 q_type)
tw_osl_free_lock(ctlr->ctlr_handle, ctlr->gen_lock);
}
-
-
/* Insert the given request at the tail of the given queue (q_type). */
static __inline TW_VOID
tw_cli_req_q_insert_tail(struct tw_cli_req_context *req, TW_UINT8 q_type)
@@ -279,8 +262,6 @@ tw_cli_req_q_insert_tail(struct tw_cli_req_context *req, TW_UINT8 q_type)
tw_osl_free_lock(ctlr->ctlr_handle, ctlr->gen_lock);
}
-
-
/* Remove and return the request at the head of the given queue (q_type). */
static __inline struct tw_cli_req_context *
tw_cli_req_q_remove_head(struct tw_cli_ctlr_context *ctlr, TW_UINT8 q_type)
@@ -300,8 +281,6 @@ tw_cli_req_q_remove_head(struct tw_cli_ctlr_context *ctlr, TW_UINT8 q_type)
return(req);
}
-
-
/* Remove the given request from the given queue (q_type). */
static __inline TW_VOID
tw_cli_req_q_remove_item(struct tw_cli_req_context *req, TW_UINT8 q_type)
@@ -314,8 +293,6 @@ tw_cli_req_q_remove_item(struct tw_cli_req_context *req, TW_UINT8 q_type)
tw_osl_free_lock(ctlr->ctlr_handle, ctlr->gen_lock);
}
-
-
/* Create an event packet for an event/error posted by the controller. */
#define tw_cli_create_ctlr_event(ctlr, event_src, cmd_hdr) do { \
TW_UINT8 severity = \
@@ -344,6 +321,4 @@ tw_cli_req_q_remove_item(struct tw_cli_req_context *req, TW_UINT8 q_type)
(cmd_hdr)->sense_data[16], (cmd_hdr)->sense_data[17]); \
} while (0)
-
-
#endif /* TW_CL_H */
diff --git a/sys/dev/twa/tw_cl_externs.h b/sys/dev/twa/tw_cl_externs.h
index 1c5a313f03f43..30ad4a297e06b 100644
--- a/sys/dev/twa/tw_cl_externs.h
+++ b/sys/dev/twa/tw_cl_externs.h
@@ -36,23 +36,18 @@
* Modifications by: Adam Radford
*/
-
-
#ifndef TW_CL_EXTERNS_H
#define TW_CL_EXTERNS_H
-
/*
* Data structures and functions global to the Common Layer.
*/
-
extern TW_INT8 tw_cli_fw_img[];
extern TW_INT32 tw_cli_fw_img_size;
extern TW_INT8 *tw_cli_severity_string_table[];
-
/* Do controller initialization. */
extern TW_INT32 tw_cli_start_ctlr(struct tw_cli_ctlr_context *ctlr);
@@ -65,8 +60,6 @@ extern TW_INT32 tw_cli_init_connection(struct tw_cli_ctlr_context *ctlr,
TW_UINT16 *fw_on_ctlr_branch, TW_UINT16 *fw_on_ctlr_build,
TW_UINT32 *init_connect_result);
-
-
/* Functions in tw_cl_io.c */
/* Submit a command packet to the firmware on the controller. */
@@ -102,8 +95,6 @@ extern TW_INT32 tw_cli_get_aen(struct tw_cli_ctlr_context *ctlr);
extern TW_VOID tw_cli_fill_sg_list(struct tw_cli_ctlr_context *ctlr,
TW_VOID *sgl_src, TW_VOID *sgl_dest, TW_INT32 num_sgl_entries);
-
-
/* Functions in tw_cl_intr.c */
/* Process a host interrupt. */
@@ -148,8 +139,6 @@ extern TW_VOID
extern TW_VOID
tw_cli_disable_interrupts(struct tw_cli_ctlr_context *ctlr_handle);
-
-
/* Functions in tw_cl_misc.c */
/* Print if dbg_level is appropriate (by calling OS Layer). */
@@ -199,6 +188,4 @@ extern TW_VOID tw_cli_notify_ctlr_info(struct tw_cli_ctlr_context *ctlr);
extern TW_INT32 tw_cli_check_ctlr_state(struct tw_cli_ctlr_context *ctlr,
TW_UINT32 status_reg);
-
-
#endif /* TW_CL_EXTERNS_H */
diff --git a/sys/dev/twa/tw_cl_fwif.h b/sys/dev/twa/tw_cl_fwif.h
index 2e3f9048a6f66..cade2249d8208 100644
--- a/sys/dev/twa/tw_cl_fwif.h
+++ b/sys/dev/twa/tw_cl_fwif.h
@@ -36,18 +36,14 @@
* Modifications by: Adam Radford
*/
-
-
#ifndef TW_CL_FWIF_H
#define TW_CL_FWIF_H
-
/*
* Macros and data structures for interfacing with the firmware.
*/
-
/* Register offsets from base address. */
#define TWA_CONTROL_REGISTER_OFFSET 0x0
#define TWA_STATUS_REGISTER_OFFSET 0x4
@@ -57,7 +53,6 @@
#define TWA_COMMAND_QUEUE_OFFSET_HIGH 0x24
#define TWA_LARGE_RESPONSE_QUEUE_OFFSET 0x30
-
/* Control register bit definitions. */
#define TWA_CONTROL_ISSUE_HOST_INTERRUPT 0x00000020
#define TWA_CONTROL_DISABLE_INTERRUPTS 0x00000040
@@ -73,7 +68,6 @@
#define TWA_CONTROL_CLEAR_QUEUE_ERROR 0x00400000
#define TWA_CONTROL_CLEAR_PARITY_ERROR 0x00800000
-
/* Status register bit definitions. */
#define TWA_STATUS_ROM_BIOS_IN_SBUF 0x00000002
#define TWA_STATUS_COMMAND_QUEUE_EMPTY 0x00001000
@@ -93,7 +87,6 @@
#define TWA_STATUS_UNEXPECTED_BITS 0x00D00000
-
/* PCI related defines. */
#define TWA_IO_CONFIG_REG 0x10
@@ -103,7 +96,6 @@
#define TWA_RESET_PHASE1_NOTIFICATION_RESPONSE 0xFFFF
#define TWA_RESET_PHASE1_WAIT_TIME_MS 500
-
/* Command packet opcodes. */
#define TWA_FW_CMD_NOP 0x00
#define TWA_FW_CMD_INIT_CONNECTION 0x01
@@ -134,7 +126,6 @@
#define TWA_FW_CMD_DIAGNOSTICS 0x1F
-
/* Misc defines. */
#define TWA_SHUTDOWN_MESSAGE_CREDITS 0x001
#define TWA_64BIT_SG_ADDRESSES 0x00000001
@@ -155,7 +146,6 @@
#define TWA_CTLR_FW_COMPATIBLE 0x00000002
#define TWA_SENSE_DATA_LENGTH 18
-
#define TWA_ARCH_ID(device_id) \
(((device_id) == TW_CL_DEVICE_ID_9K) ? TWA_ARCH_ID_9K : \
TWA_ARCH_ID_9K_X)
@@ -175,7 +165,6 @@
#define TWA_SG_ELEMENT_SIZE_FACTOR(device_id) \
(((device_id) == TW_CL_DEVICE_ID_9K) ? 512 : 4)
-
/*
* Some errors of interest (in cmd_hdr->status_block.error) when a command
* is completed by the firmware with a bad status.
@@ -184,13 +173,11 @@
#define TWA_ERROR_UNIT_OFFLINE 0x0128
#define TWA_ERROR_MORE_DATA 0x0231
-
/* AEN codes of interest. */
#define TWA_AEN_QUEUE_EMPTY 0x00
#define TWA_AEN_SOFT_RESET 0x01
#define TWA_AEN_SYNC_TIME_WITH_HOST 0x31
-
/* Table #'s and id's of parameters of interest in firmware's param table. */
#define TWA_PARAM_VERSION_TABLE 0x0402
#define TWA_PARAM_VERSION_FW 3 /* firmware version [16] */
@@ -205,7 +192,6 @@
#define TWA_9K_PARAM_DESCRIPTOR 0x8000
-
#pragma pack(1)
/* 7000 structures. */
struct tw_cl_command_init_connect {
@@ -224,7 +210,6 @@ struct tw_cl_command_init_connect {
TW_UINT32 result;
};
-
/* Structure for downloading firmware onto the controller. */
struct tw_cl_command_download_firmware {
TW_UINT8 sgl_off__opcode;/* 3:5 */
@@ -237,7 +222,6 @@ struct tw_cl_command_download_firmware {
TW_UINT8 sgl[1];
};
-
/* Structure for hard resetting the controller. */
struct tw_cl_command_reset_firmware {
TW_UINT8 res1__opcode; /* 3:5 */
@@ -250,7 +234,6 @@ struct tw_cl_command_reset_firmware {
TW_UINT8 param;
};
-
/* Structure for sending get/set param commands. */
struct tw_cl_command_param {
TW_UINT8 sgl_off__opcode;/* 3:5 */
@@ -263,7 +246,6 @@ struct tw_cl_command_param {
TW_UINT8 sgl[1];
};
-
/* Generic command packet. */
struct tw_cl_command_generic {
TW_UINT8 sgl_off__opcode;/* 3:5 */
@@ -275,7 +257,6 @@ struct tw_cl_command_generic {
TW_UINT16 count; /* block cnt, parameter cnt, message credits */
};
-
/* Command packet header. */
struct tw_cl_command_header {
TW_UINT8 sense_data[TWA_SENSE_DATA_LENGTH];
@@ -293,7 +274,6 @@ struct tw_cl_command_header {
} header_desc;
};
-
/* 7000 Command packet. */
union tw_cl_command_7k {
struct tw_cl_command_init_connect init_connect;
@@ -304,7 +284,6 @@ union tw_cl_command_7k {
TW_UINT8 padding[1024 - sizeof(struct tw_cl_command_header)];
};
-
/* 9000 Command Packet. */
struct tw_cl_command_9k {
TW_UINT8 res__opcode; /* 3:5 */
@@ -319,7 +298,6 @@ struct tw_cl_command_9k {
1024-sizeof(cmd_hdr) */
};
-
/* Full command packet. */
struct tw_cl_command_packet {
struct tw_cl_command_header cmd_hdr;
@@ -329,7 +307,6 @@ struct tw_cl_command_packet {
} command;
};
-
/* Structure describing payload for get/set param commands. */
struct tw_cl_param_9k {
TW_UINT16 table_id;
@@ -341,16 +318,13 @@ struct tw_cl_param_9k {
};
#pragma pack()
-
/* Functions to read from, and write to registers */
#define TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, value) \
tw_osl_write_reg(ctlr_handle, TWA_CONTROL_REGISTER_OFFSET, value, 4)
-
#define TW_CLI_READ_STATUS_REGISTER(ctlr_handle) \
tw_osl_read_reg(ctlr_handle, TWA_STATUS_REGISTER_OFFSET, 4)
-
#define TW_CLI_WRITE_COMMAND_QUEUE(ctlr_handle, value) do { \
if (ctlr->flags & TW_CL_64BIT_ADDRESSES) { \
/* First write the low 4 bytes, then the high 4. */ \
@@ -363,15 +337,12 @@ struct tw_cl_param_9k {
(TW_UINT32)(value), 4); \
} while (0)
-
#define TW_CLI_READ_RESPONSE_QUEUE(ctlr_handle) \
tw_osl_read_reg(ctlr_handle, TWA_RESPONSE_QUEUE_OFFSET, 4)
-
#define TW_CLI_READ_LARGE_RESPONSE_QUEUE(ctlr_handle) \
tw_osl_read_reg(ctlr_handle, TWA_LARGE_RESPONSE_QUEUE_OFFSET, 4)
-
#define TW_CLI_SOFT_RESET(ctlr) \
TW_CLI_WRITE_CONTROL_REGISTER(ctlr, \
TWA_CONTROL_ISSUE_SOFT_RESET | \
@@ -386,7 +357,6 @@ struct tw_cl_param_9k {
((x & TWA_STATUS_UNEXPECTED_BITS) && \
(x & TWA_STATUS_MICROCONTROLLER_READY))
-
/*
* Functions for making transparent, the bit fields in firmware
* interface structures.
@@ -409,7 +379,6 @@ struct tw_cl_param_9k {
#define BUILD_LUN_H4__SGL_ENTRIES(lun, sgl_entries) \
(((lun << 8) & 0xF000) | (sgl_entries & 0xFFF)) /* 4:12 */
-
#define GET_OPCODE(sgl_off__opcode) \
(sgl_off__opcode & 0x1F) /* 3:5 */
@@ -446,6 +415,4 @@ struct tw_cl_param_9k {
#define GET_LUN_H4(lun_h4__sgl_entries) \
((lun_h4__sgl_entries >> 12) & 0xF) /* 4:12 */
-
-
#endif /* TW_CL_FWIF_H */
diff --git a/sys/dev/twa/tw_cl_init.c b/sys/dev/twa/tw_cl_init.c
index 29ed60e58b7d9..ce213ed531efe 100644
--- a/sys/dev/twa/tw_cl_init.c
+++ b/sys/dev/twa/tw_cl_init.c
@@ -37,12 +37,10 @@
* Modifications by: Manjunath Ranganathaiah
*/
-
/*
* Common Layer initialization functions.
*/
-
#include "tw_osl_share.h"
#include "tw_cl_share.h"
#include "tw_cl_fwif.h"
@@ -51,7 +49,6 @@
#include "tw_cl_externs.h"
#include "tw_osl_ioctl.h"
-
/*
* Function name: tw_cl_ctlr_supported
* Description: Determines if a controller is supported.
@@ -74,8 +71,6 @@ tw_cl_ctlr_supported(TW_INT32 vendor_id, TW_INT32 device_id)
return(TW_CL_FALSE);
}
-
-
/*
* Function name: tw_cl_get_pci_bar_info
* Description: Returns PCI BAR info.
@@ -150,8 +145,6 @@ tw_cl_get_pci_bar_info(TW_INT32 device_id, TW_INT32 bar_type,
return(error);
}
-
-
/*
* Function name: tw_cl_get_mem_requirements
* Description: Provides info about Common Layer requirements for a
@@ -213,7 +206,6 @@ tw_cl_get_mem_requirements(struct tw_cl_ctlr_handle *ctlr_handle,
(sizeof(struct tw_cli_req_context) * max_simult_reqs) +
(sizeof(struct tw_cl_event_packet) * max_aens);
-
/*
* Total DMA'able memory needed is the sum total of memory needed for
* all command packets (including the 1 needed for CL internal
@@ -227,8 +219,6 @@ tw_cl_get_mem_requirements(struct tw_cl_ctlr_handle *ctlr_handle,
return(0);
}
-
-
/*
* Function name: tw_cl_init_ctlr
* Description: Initializes driver data structures for the controller.
@@ -357,7 +347,6 @@ tw_cl_init_ctlr(struct tw_cl_ctlr_handle *ctlr_handle, TW_UINT32 flags,
/* Initialize the AEN queue. */
ctlr->aen_queue = (struct tw_cl_event_packet *)free_non_dma_mem;
-
start_ctlr:
/*
* Disable interrupts. Interrupts will be enabled in tw_cli_start_ctlr
@@ -545,7 +534,6 @@ tw_cli_start_ctlr(struct tw_cli_ctlr_context *ctlr)
return(TW_OSL_ESUCCESS);
}
-
/*
* Function name: tw_cl_shutdown_ctlr
* Description: Closes logical connection with the controller.
@@ -593,8 +581,6 @@ ret:
return(error);
}
-
-
/*
* Function name: tw_cli_init_connection
* Description: Sends init_connection cmd to firmware
@@ -708,5 +694,3 @@ out:
tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q);
return(error);
}
-
-
diff --git a/sys/dev/twa/tw_cl_intr.c b/sys/dev/twa/tw_cl_intr.c
index aa89f79d92a98..85f96da3046d8 100644
--- a/sys/dev/twa/tw_cl_intr.c
+++ b/sys/dev/twa/tw_cl_intr.c
@@ -37,12 +37,10 @@
* Modifications by: Manjunath Ranganathaiah
*/
-
/*
* Common Layer interrupt handling functions.
*/
-
#include "tw_osl_share.h"
#include "tw_cl_share.h"
#include "tw_cl_fwif.h"
@@ -51,8 +49,6 @@
#include "tw_cl_externs.h"
#include "tw_osl_ioctl.h"
-
-
/*
* Function name: twa_interrupt
* Description: Interrupt handler. Determines the kind of interrupt,
@@ -122,8 +118,6 @@ out:
return(rc);
}
-
-
/*
* Function name: tw_cli_process_host_intr
* Description: This function gets called if we triggered an interrupt.
@@ -139,8 +133,6 @@ tw_cli_process_host_intr(struct tw_cli_ctlr_context *ctlr)
tw_cli_dbg_printf(6, ctlr->ctlr_handle, tw_osl_cur_func(), "entered");
}
-
-
/*
* Function name: tw_cli_process_attn_intr
* Description: This function gets called if the fw posted an AEN
@@ -175,8 +167,6 @@ tw_cli_process_attn_intr(struct tw_cli_ctlr_context *ctlr)
}
}
-
-
/*
* Function name: tw_cli_process_cmd_intr
* Description: This function gets called if we hit a queue full
@@ -202,8 +192,6 @@ tw_cli_process_cmd_intr(struct tw_cli_ctlr_context *ctlr)
*/
}
-
-
/*
* Function name: tw_cli_process_resp_intr
* Description: Looks for cmd completions from fw; queues cmds completed
@@ -260,17 +248,14 @@ tw_cli_process_resp_intr(struct tw_cli_ctlr_context *ctlr)
tw_cli_req_q_remove_item(req, TW_CLI_BUSY_Q);
req->state = TW_CLI_REQ_STATE_COMPLETE;
tw_cli_req_q_insert_tail(req, TW_CLI_COMPLETE_Q);
-
}
/* Complete this, and other requests in the complete queue. */
tw_cli_process_complete_queue(ctlr);
-
+
return(error);
}
-
-
/*
* Function name: tw_cli_submit_pending_queue
* Description: Kick starts any requests in the pending queue.
@@ -287,7 +272,7 @@ tw_cli_submit_pending_queue(struct tw_cli_ctlr_context *ctlr)
TW_INT32 error = TW_OSL_ESUCCESS;
tw_cli_dbg_printf(3, ctlr->ctlr_handle, tw_osl_cur_func(), "entered");
-
+
/*
* Pull requests off the pending queue, and submit them.
*/
@@ -339,8 +324,6 @@ tw_cli_submit_pending_queue(struct tw_cli_ctlr_context *ctlr)
return(error);
}
-
-
/*
* Function name: tw_cli_process_complete_queue
* Description: Calls the CL internal callback routine, if any, for
@@ -368,8 +351,6 @@ tw_cli_process_complete_queue(struct tw_cli_ctlr_context *ctlr)
}
}
-
-
/*
* Function name: tw_cli_complete_io
* Description: CL internal callback for SCSI/fw passthru requests.
@@ -418,8 +399,6 @@ out:
tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q);
}
-
-
/*
* Function name: tw_cli_scsi_complete
* Description: Completion routine for SCSI requests.
@@ -505,8 +484,6 @@ tw_cli_scsi_complete(struct tw_cli_req_context *req)
req_pkt->status |= TW_CL_ERR_REQ_SCSI_ERROR;
}
-
-
/*
* Function name: tw_cli_param_callback
* Description: Callback for get/set_param requests.
@@ -559,8 +536,6 @@ tw_cli_param_callback(struct tw_cli_req_context *req)
}
}
-
-
/*
* Function name: tw_cli_aen_callback
* Description: Callback for requests to fetch AEN's.
@@ -632,8 +607,6 @@ tw_cli_aen_callback(struct tw_cli_req_context *req)
}
}
-
-
/*
* Function name: tw_cli_manage_aen
* Description: Handles AEN's.
@@ -694,13 +667,11 @@ tw_cli_manage_aen(struct tw_cli_ctlr_context *ctlr,
break;
-
case TWA_AEN_QUEUE_EMPTY:
tw_cli_dbg_printf(4, ctlr->ctlr_handle, tw_osl_cur_func(),
"AEN queue empty");
break;
-
default:
/* Queue the event. */
@@ -714,8 +685,6 @@ tw_cli_manage_aen(struct tw_cli_ctlr_context *ctlr,
return(aen_code);
}
-
-
/*
* Function name: tw_cli_enable_interrupts
* Description: Enables interrupts on the controller
@@ -736,8 +705,6 @@ tw_cli_enable_interrupts(struct tw_cli_ctlr_context *ctlr)
TWA_CONTROL_ENABLE_INTERRUPTS);
}
-
-
/*
* Function name: twa_setup
* Description: Disables interrupts on the controller
@@ -755,4 +722,3 @@ tw_cli_disable_interrupts(struct tw_cli_ctlr_context *ctlr)
TWA_CONTROL_DISABLE_INTERRUPTS);
ctlr->interrupts_enabled = TW_CL_FALSE;
}
-
diff --git a/sys/dev/twa/tw_cl_io.c b/sys/dev/twa/tw_cl_io.c
index 77d69a3a37c4c..a2a84f4daf694 100644
--- a/sys/dev/twa/tw_cl_io.c
+++ b/sys/dev/twa/tw_cl_io.c
@@ -37,12 +37,10 @@
* Modifications by: Manjunath Ranganathaiah
*/
-
/*
* Common Layer I/O functions.
*/
-
#include "tw_osl_share.h"
#include "tw_cl_share.h"
#include "tw_cl_fwif.h"
@@ -55,8 +53,6 @@
#include <cam/cam_ccb.h>
#include <cam/cam_xpt_sim.h>
-
-
/*
* Function name: tw_cl_start_io
* Description: Interface to OS Layer for accepting SCSI requests.
@@ -155,8 +151,6 @@ tw_cl_start_io(struct tw_cl_ctlr_handle *ctlr_handle,
return(error);
}
-
-
/*
* Function name: tw_cli_submit_cmd
* Description: Submits a cmd to firmware.
@@ -247,8 +241,6 @@ tw_cli_submit_cmd(struct tw_cli_req_context *req)
return(error);
}
-
-
/*
* Function name: tw_cl_fw_passthru
* Description: Interface to OS Layer for accepting firmware
@@ -353,8 +345,6 @@ tw_cl_fw_passthru(struct tw_cl_ctlr_handle *ctlr_handle,
return(error);
}
-
-
/*
* Function name: tw_cl_ioctl
* Description: Handler of CL supported ioctl cmds.
@@ -421,7 +411,6 @@ tw_cl_ioctl(struct tw_cl_ctlr_handle *ctlr_handle, u_long cmd, TW_VOID *buf)
break;
-
case TW_CL_IOCTL_GET_LAST_EVENT:
tw_cli_dbg_printf(3, ctlr_handle, tw_osl_cur_func(),
"Get Last Event");
@@ -457,7 +446,6 @@ tw_cl_ioctl(struct tw_cl_ctlr_handle *ctlr_handle, u_long cmd, TW_VOID *buf)
break;
-
case TW_CL_IOCTL_GET_NEXT_EVENT:
tw_cli_dbg_printf(3, ctlr_handle, tw_osl_cur_func(),
"Get Next Event");
@@ -535,7 +523,6 @@ tw_cl_ioctl(struct tw_cl_ctlr_handle *ctlr_handle, u_long cmd, TW_VOID *buf)
break;
-
case TW_CL_IOCTL_GET_PREVIOUS_EVENT:
tw_cli_dbg_printf(3, ctlr_handle, tw_osl_cur_func(),
"Get Previous Event");
@@ -598,7 +585,6 @@ tw_cl_ioctl(struct tw_cl_ctlr_handle *ctlr_handle, u_long cmd, TW_VOID *buf)
break;
-
case TW_CL_IOCTL_GET_LOCK:
{
struct tw_cl_lock_packet lock_pkt;
@@ -634,7 +620,6 @@ tw_cl_ioctl(struct tw_cl_ctlr_handle *ctlr_handle, u_long cmd, TW_VOID *buf)
break;
}
-
case TW_CL_IOCTL_RELEASE_LOCK:
tw_cli_dbg_printf(3, ctlr_handle, tw_osl_cur_func(),
"Release ioctl lock");
@@ -652,7 +637,6 @@ tw_cl_ioctl(struct tw_cl_ctlr_handle *ctlr_handle, u_long cmd, TW_VOID *buf)
}
break;
-
case TW_CL_IOCTL_GET_COMPATIBILITY_INFO:
{
struct tw_cl_compatibility_packet comp_pkt;
@@ -699,8 +683,6 @@ tw_cl_ioctl(struct tw_cl_ctlr_handle *ctlr_handle, u_long cmd, TW_VOID *buf)
return(error);
}
-
-
/*
* Function name: tw_cli_get_param
* Description: Get a firmware parameter.
@@ -816,8 +798,6 @@ out:
return(1);
}
-
-
/*
* Function name: tw_cli_set_param
* Description: Set a firmware parameter.
@@ -933,8 +913,6 @@ out:
return(error);
}
-
-
/*
* Function name: tw_cli_submit_and_poll_request
* Description: Sends down a firmware cmd, and waits for the completion
@@ -1034,8 +1012,6 @@ tw_cli_submit_and_poll_request(struct tw_cli_req_context *req,
return(TW_OSL_ETIMEDOUT);
}
-
-
/*
* Function name: tw_cl_reset_ctlr
* Description: Soft resets and then initializes the controller;
@@ -1062,7 +1038,6 @@ tw_cl_reset_ctlr(struct tw_cl_ctlr_handle *ctlr_handle)
ctlr->reset_in_progress = TW_CL_TRUE;
twa_teardown_intr(sc);
-
/*
* Error back all requests in the complete, busy, and pending queues.
* If any request is already on its way to getting submitted, it's in
@@ -1159,8 +1134,6 @@ tw_cl_is_active(struct tw_cl_ctlr_handle *ctlr_handle)
return(ctlr->active);
}
-
-
/*
* Function name: tw_cli_soft_reset
* Description: Does the actual soft reset.
@@ -1253,7 +1226,7 @@ tw_cli_soft_reset(struct tw_cli_ctlr_context *ctlr)
tw_osl_free_lock(ctlr_handle, ctlr->io_lock);
return(error);
}
-
+
tw_osl_free_lock(ctlr_handle, ctlr->io_lock);
if ((error = tw_cli_drain_aen_queue(ctlr))) {
@@ -1264,7 +1237,7 @@ tw_cli_soft_reset(struct tw_cli_ctlr_context *ctlr)
"error = %d", error);
return(error);
}
-
+
if ((error = tw_cli_find_aen(ctlr, TWA_AEN_SOFT_RESET))) {
tw_cl_create_event(ctlr_handle, TW_CL_FALSE,
TW_CL_MESSAGE_SOURCE_COMMON_LAYER_EVENT,
@@ -1277,8 +1250,6 @@ tw_cli_soft_reset(struct tw_cli_ctlr_context *ctlr)
return(TW_OSL_ESUCCESS);
}
-
-
/*
* Function name: tw_cli_send_scsi_cmd
* Description: Sends down a scsi cmd to fw.
@@ -1350,8 +1321,6 @@ tw_cli_send_scsi_cmd(struct tw_cli_req_context *req, TW_INT32 cmd)
return(TW_OSL_ESUCCESS);
}
-
-
/*
* Function name: tw_cli_get_aen
* Description: Sends down a Request Sense cmd to fw to fetch an AEN.
@@ -1387,8 +1356,6 @@ tw_cli_get_aen(struct tw_cli_ctlr_context *ctlr)
return(error);
}
-
-
/*
* Function name: tw_cli_fill_sg_list
* Description: Fills in the scatter/gather list.
@@ -1438,4 +1405,3 @@ tw_cli_fill_sg_list(struct tw_cli_ctlr_context *ctlr, TW_VOID *sgl_src,
}
}
}
-
diff --git a/sys/dev/twa/tw_cl_ioctl.h b/sys/dev/twa/tw_cl_ioctl.h
index 6c10b0bcefa15..ca1bc10b0c3d1 100644
--- a/sys/dev/twa/tw_cl_ioctl.h
+++ b/sys/dev/twa/tw_cl_ioctl.h
@@ -36,18 +36,14 @@
* Modifications by: Adam Radford
*/
-
-
#ifndef TW_CL_IOCTL_H
#define TW_CL_IOCTL_H
-
/*
* Macros and structures for Common Layer handled ioctls.
*/
-
#define TW_CL_AEN_NOT_RETRIEVED 0x1
#define TW_CL_AEN_RETRIEVED 0x2
@@ -57,7 +53,6 @@
#define TW_CL_ERROR_IOCTL_LOCK_NOT_HELD 0x1001 /* Not locked */
#define TW_CL_ERROR_IOCTL_LOCK_ALREADY_HELD 0x1002 /* Already locked */
-
#pragma pack(1)
/* Structure used to handle GET/RELEASE LOCK ioctls. */
@@ -67,7 +62,6 @@ struct tw_cl_lock_packet {
TW_UINT32 force_flag;
};
-
/* Structure used to handle GET COMPATIBILITY INFO ioctl. */
struct tw_cl_compatibility_packet {
TW_UINT8 driver_version[32];/* driver version */
@@ -87,7 +81,6 @@ struct tw_cl_compatibility_packet {
TW_UINT16 fw_on_ctlr_build;/* build # of running firmware */
};
-
/* Driver understandable part of the ioctl packet built by the API. */
struct tw_cl_driver_packet {
TW_UINT32 control_code;
@@ -98,7 +91,6 @@ struct tw_cl_driver_packet {
TW_UINT32 buffer_length;
};
-
/* ioctl packet built by the API. */
struct tw_cl_ioctl_packet {
struct tw_cl_driver_packet driver_pkt;
@@ -109,6 +101,4 @@ struct tw_cl_ioctl_packet {
#pragma pack()
-
-
#endif /* TW_CL_IOCTL_H */
diff --git a/sys/dev/twa/tw_cl_misc.c b/sys/dev/twa/tw_cl_misc.c
index 4a0c5f3839eaf..fd2fb040eaaca 100644
--- a/sys/dev/twa/tw_cl_misc.c
+++ b/sys/dev/twa/tw_cl_misc.c
@@ -37,12 +37,10 @@
* Modifications by: Manjunath Ranganathaiah
*/
-
/*
* Common Layer miscellaneous functions.
*/
-
#include "tw_osl_share.h"
#include "tw_cl_share.h"
#include "tw_cl_fwif.h"
@@ -51,8 +49,6 @@
#include "tw_cl_externs.h"
#include "tw_osl_ioctl.h"
-
-
/* AEN severity table. */
TW_INT8 *tw_cli_severity_string_table[] = {
"None",
@@ -63,8 +59,6 @@ TW_INT8 *tw_cli_severity_string_table[] = {
""
};
-
-
/*
* Function name: tw_cli_drain_complete_queue
* Description: This function gets called during a controller reset.
@@ -117,8 +111,6 @@ tw_cli_drain_complete_queue(struct tw_cli_ctlr_context *ctlr)
} /* End of while loop */
}
-
-
/*
* Function name: tw_cli_drain_busy_queue
* Description: This function gets called during a controller reset.
@@ -171,8 +163,6 @@ tw_cli_drain_busy_queue(struct tw_cli_ctlr_context *ctlr)
} /* End of while loop */
}
-
-
/*
* Function name: tw_cli_drain_pending_queue
* Description: This function gets called during a controller reset.
@@ -191,7 +181,7 @@ tw_cli_drain_pending_queue(struct tw_cli_ctlr_context *ctlr)
struct tw_cl_req_packet *req_pkt;
tw_cli_dbg_printf(3, ctlr->ctlr_handle, tw_osl_cur_func(), "entered");
-
+
/*
* Pull requests off the pending queue, and complete them.
*/
@@ -227,8 +217,6 @@ tw_cli_drain_pending_queue(struct tw_cli_ctlr_context *ctlr)
} /* End of while loop */
}
-
-
/*
* Function name: tw_cli_drain_response_queue
* Description: Drain the controller response queue.
@@ -256,8 +244,6 @@ tw_cli_drain_response_queue(struct tw_cli_ctlr_context *ctlr)
}
}
-
-
/*
* Function name: tw_cli_find_response
* Description: Find a particular response in the ctlr response queue.
@@ -296,8 +282,6 @@ tw_cli_find_response(struct tw_cli_ctlr_context *ctlr, TW_INT32 req_id)
}
}
-
-
/*
* Function name: tw_cli_drain_aen_queue
* Description: Fetches all un-retrieved AEN's posted by fw.
@@ -387,8 +371,6 @@ out:
return(error);
}
-
-
/*
* Function name: tw_cli_find_aen
* Description: Reports whether a given AEN ever occurred.
@@ -423,8 +405,6 @@ tw_cli_find_aen(struct tw_cli_ctlr_context *ctlr, TW_UINT16 aen_code)
return(TW_OSL_EGENFAILURE);
}
-
-
/*
* Function name: tw_cli_poll_status
* Description: Poll for a given status to show up in the firmware
@@ -459,8 +439,6 @@ tw_cli_poll_status(struct tw_cli_ctlr_context *ctlr, TW_UINT32 status,
return(TW_OSL_ETIMEDOUT);
}
-
-
/*
* Function name: tw_cl_create_event
* Description: Creates and queues ctlr/CL/OSL AEN's to be
@@ -555,8 +533,6 @@ tw_cl_create_event(struct tw_cl_ctlr_handle *ctlr_handle,
tw_osl_notify_event(ctlr_handle, event);
}
-
-
/*
* Function name: tw_cli_get_request
* Description: Gets a request pkt from the free queue.
@@ -605,13 +581,10 @@ tw_cli_get_request(struct tw_cli_ctlr_context *ctlr
else
tw_osl_memzero(&(req->cmd_pkt->command),
28 /* max bytes before sglist */);
-
}
return(req);
}
-
-
/*
* Function name: tw_cli_dbg_printf
* Description: Calls OSL print function if dbg_level is appropriate
@@ -648,8 +621,6 @@ tw_cli_dbg_printf(TW_UINT8 dbg_level,
#endif /* TW_OSL_DEBUG */
}
-
-
/*
* Function name: tw_cli_notify_ctlr_info
* Description: Notify OSL of controller info (fw/BIOS versions, etc.).
@@ -693,8 +664,6 @@ tw_cli_notify_ctlr_info(struct tw_cli_ctlr_context *ctlr)
error[1]?(TW_INT8 *)TW_CL_NULL:bios_ver);
}
-
-
/*
* Function name: tw_cli_check_ctlr_state
* Description: Makes sure that the fw status register reports a
@@ -789,7 +758,6 @@ tw_cli_check_ctlr_state(struct tw_cli_ctlr_context *ctlr, TW_UINT32 status_reg)
TW_CLI_PCI_CONFIG_STATUS_OFFSET,
TWA_PCI_CONFIG_CLEAR_PCI_ABORT, 2);
#endif /* TW_OSL_PCI_CONFIG_ACCESSIBLE */
-
}
if (status_reg & TWA_STATUS_QUEUE_ERROR_INTERRUPT) {
@@ -811,8 +779,6 @@ tw_cli_check_ctlr_state(struct tw_cli_ctlr_context *ctlr, TW_UINT32 status_reg)
return(error);
}
-
-
/*
* Function name: tw_cli_describe_bits
* Description: Given the value of the status register, returns a
@@ -854,8 +820,6 @@ tw_cli_describe_bits(TW_UINT32 reg, TW_INT8 *str)
return(str);
}
-
-
#ifdef TW_OSL_DEBUG
/*
@@ -901,8 +865,6 @@ tw_cl_print_ctlr_stats(struct tw_cl_ctlr_handle *ctlr_handle)
ctlr->aen_head, ctlr->aen_tail);
}
-
-
/*
* Function name: tw_cl_reset_stats
* Description: Resets CL maintained statistics for the controller.
@@ -924,8 +886,6 @@ tw_cl_reset_stats(struct tw_cl_ctlr_handle *ctlr_handle)
ctlr->q_stats[TW_CLI_COMPLETE_Q].max_len = 0;
}
-
-
/*
* Function name: tw_cli_print_req_info
* Description: Prints CL internal details of a given request.
@@ -1029,4 +989,3 @@ tw_cl_print_req_info(struct tw_cl_req_handle *req_handle)
}
#endif /* TW_OSL_DEBUG */
-
diff --git a/sys/dev/twa/tw_cl_share.h b/sys/dev/twa/tw_cl_share.h
index ff252dec9fbfb..b699f70c0b7b6 100644
--- a/sys/dev/twa/tw_cl_share.h
+++ b/sys/dev/twa/tw_cl_share.h
@@ -37,13 +37,10 @@
* Modifications by: Manjunath Ranganathaiah
*/
-
-
#ifndef TW_CL_SHARE_H
#define TW_CL_SHARE_H
-
/*
* Macros, structures and functions shared between OSL and CL,
* and defined by CL.
@@ -83,7 +80,6 @@
#define TW_CL_MAX_32BIT_SG_ELEMENTS 109 /* max 32-bit sg elements */
#define TW_CL_MAX_64BIT_SG_ELEMENTS 72 /* max 64-bit sg elements */
-
/* Possible values of ctlr->flags */
#define TW_CL_64BIT_ADDRESSES (1<<0) /* 64 bit cmdpkt & SG addresses */
#define TW_CL_64BIT_SG_LENGTH (1<<1) /* 64 bit SG length */
@@ -101,12 +97,10 @@
#define TW_CL_ERR_REQ_BUS_RESET (1<<5)
#define TW_CL_ERR_REQ_UNABLE_TO_SUBMIT_COMMAND (1<<6)
-
/* Possible values of req_pkt->flags */
#define TW_CL_REQ_RETRY_ON_BUSY (1<<0)
#define TW_CL_REQ_CALLBACK_FOR_SGLIST (1<<1)
-
#define TW_CL_MESSAGE_SOURCE_CONTROLLER_ERROR 3
#define TW_CL_MESSAGE_SOURCE_CONTROLLER_EVENT 4
#define TW_CL_MESSAGE_SOURCE_COMMON_LAYER_ERROR 21
@@ -126,8 +120,6 @@
#define TW_CL_SEVERITY_INFO_STRING "INFO"
#define TW_CL_SEVERITY_DEBUG_STRING "DEBUG"
-
-
/*
* Structure, a pointer to which is used as the controller handle in
* communications between the OS Layer and the Common Layer.
@@ -137,7 +129,6 @@ struct tw_cl_ctlr_handle {
TW_VOID *cl_ctlr_ctxt; /* CL's ctlr context */
};
-
/*
* Structure, a pointer to which is used as the request handle in
* communications between the OS Layer and the Common Layer.
@@ -148,7 +139,6 @@ struct tw_cl_req_handle {
TW_UINT8 is_io; /* Only freeze/release simq for IOs */
};
-
/* Structure used to describe SCSI requests to CL. */
struct tw_cl_scsi_req_packet {
TW_UINT32 unit; /* unit # to send cmd to */
@@ -162,7 +152,6 @@ struct tw_cl_scsi_req_packet {
TW_UINT8 *sg_list; /* ptr to SG list */
};
-
/* Structure used to describe pass through command packets to CL. */
struct tw_cl_passthru_req_packet {
TW_UINT8 *cmd_pkt; /* ptr to passthru cmd pkt */
@@ -171,7 +160,6 @@ struct tw_cl_passthru_req_packet {
TW_UINT8 *sg_list; /* ptr to SG list */
};
-
/* Request packet submitted to the Common Layer, by the OS Layer. */
struct tw_cl_req_packet {
TW_UINT32 cmd; /* Common Layer cmd */
@@ -190,7 +178,6 @@ struct tw_cl_req_packet {
} gen_req_pkt;
};
-
#pragma pack(1)
/*
* Packet that describes an AEN/error generated by the controller,
@@ -210,14 +197,12 @@ struct tw_cl_event_packet {
};
#pragma pack()
-
/* Structure to link 2 adjacent elements in a list. */
struct tw_cl_link {
struct tw_cl_link *next;
struct tw_cl_link *prev;
};
-
#pragma pack(1)
/* Scatter/Gather list entry with 32 bit addresses. */
struct tw_cl_sg_desc32 {
@@ -225,7 +210,6 @@ struct tw_cl_sg_desc32 {
TW_UINT32 length;
};
-
/* Scatter/Gather list entry with 64 bit addresses. */
struct tw_cl_sg_desc64 {
TW_UINT64 address;
@@ -234,24 +218,20 @@ struct tw_cl_sg_desc64 {
#pragma pack()
-
/* Byte swap functions. Valid only if running on big endian platforms. */
#ifdef TW_OSL_BIG_ENDIAN
#define TW_CL_SWAP16_WITH_CAST(x) \
((x << 8) | (x >> 8))
-
#define TW_CL_SWAP32_WITH_CAST(x) \
((x << 24) | ((x << 8) & (0xFF0000)) | \
((x >> 8) & (0xFF00)) | (x >> 24))
-
#define TW_CL_SWAP64_WITH_CAST(x) \
((((TW_UINT64)(TW_CL_SWAP32(((TW_UINT32 *)(&(x)))[1]))) << 32) |\
((TW_UINT32)(TW_CL_SWAP32(((TW_UINT32 *)(&(x)))[0]))))
-
#else /* TW_OSL_BIG_ENDIAN */
#define TW_CL_SWAP16_WITH_CAST(x) x
@@ -264,7 +244,6 @@ struct tw_cl_sg_desc64 {
#define TW_CL_SWAP32(x) TW_CL_SWAP32_WITH_CAST((TW_UINT32)(x))
#define TW_CL_SWAP64(x) TW_CL_SWAP64_WITH_CAST((TW_UINT64)(x))
-
/* Queue manipulation functions. */
/* Initialize a queue. */
@@ -272,7 +251,6 @@ struct tw_cl_sg_desc64 {
(head)->prev = (head)->next = head; \
} while (0)
-
/* Insert an item at the head of the queue. */
#define TW_CL_Q_INSERT_HEAD(head, item) do { \
(item)->next = (head)->next; \
@@ -281,7 +259,6 @@ struct tw_cl_sg_desc64 {
(head)->next = item; \
} while (0)
-
/* Insert an item at the tail of the queue. */
#define TW_CL_Q_INSERT_TAIL(head, item) do { \
(item)->next = head; \
@@ -290,39 +267,32 @@ struct tw_cl_sg_desc64 {
(head)->prev = item; \
} while (0)
-
/* Remove an item from the head of the queue. */
#define TW_CL_Q_REMOVE_ITEM(head, item) do { \
(item)->prev->next = (item)->next; \
(item)->next->prev = (item)->prev; \
} while (0)
-
/* Retrieve the item at the head of the queue. */
#define TW_CL_Q_FIRST_ITEM(head) \
(((head)->next != head) ? ((head)->next) : TW_CL_NULL)
-
/* Retrieve the item at the tail of the queue. */
#define TW_CL_Q_LAST_ITEM(head) \
(((head)->prev != head) ? ((head)->prev) : TW_CL_NULL)
-
/* Retrieve the item next to a given item in the queue. */
#define TW_CL_Q_NEXT_ITEM(head, item) \
(((item)->next != head) ? ((item)->next) : TW_CL_NULL)
-
/* Retrieve the item previous to a given item in the queue. */
#define TW_CL_Q_PREV_ITEM(head, item) \
(((item)->prev != head) ? ((item)->prev) : TW_CL_NULL)
-
/* Determine the offset of a field from the head of the structure it is in. */
#define TW_CL_STRUCT_OFFSET(struct_type, field) \
(TW_INT8 *)(&((struct_type *)0)->field)
-
/*
* Determine the address of the head of a structure, given the address of a
* field within it.
@@ -331,14 +301,10 @@ struct tw_cl_sg_desc64 {
(struct_type *)((TW_INT8 *)addr - \
TW_CL_STRUCT_OFFSET(struct_type, field))
-
-
#ifndef TW_BUILDING_API
#include "tw_osl_inline.h"
-
-
/*
* The following are extern declarations of OS Layer defined functions called
* by the Common Layer. If any function has been defined as a macro in
@@ -350,7 +316,6 @@ struct tw_cl_sg_desc64 {
extern TW_VOID tw_osl_breakpoint(TW_VOID);
#endif
-
#ifndef tw_osl_timeout
/* Start OS timeout() routine after controller reset sequence */
extern TW_VOID tw_osl_timeout(struct tw_cl_req_handle *req_handle);
@@ -361,13 +326,11 @@ extern TW_VOID tw_osl_timeout(struct tw_cl_req_handle *req_handle);
extern TW_VOID tw_osl_untimeout(struct tw_cl_req_handle *req_handle);
#endif
-
#ifndef tw_osl_cur_func
/* Text name of current function. */
extern TW_INT8 *tw_osl_cur_func(TW_VOID);
#endif
-
#ifdef TW_OSL_DEBUG
#ifndef tw_osl_dbg_printf
/* Print to syslog/event log/debug console, as applicable. */
@@ -376,66 +339,56 @@ extern TW_INT32 tw_osl_dbg_printf(struct tw_cl_ctlr_handle *ctlr_handle,
#endif
#endif /* TW_OSL_DEBUG */
-
#ifndef tw_osl_delay
/* Cause a delay of usecs micro-seconds. */
extern TW_VOID tw_osl_delay(TW_INT32 usecs);
#endif
-
#ifndef tw_osl_destroy_lock
/* Create/initialize a lock for CL's use. */
extern TW_VOID tw_osl_destroy_lock(struct tw_cl_ctlr_handle *ctlr_handle,
TW_LOCK_HANDLE *lock);
#endif
-
#ifndef tw_osl_free_lock
/* Free a previously held lock. */
extern TW_VOID tw_osl_free_lock(struct tw_cl_ctlr_handle *ctlr_handle,
TW_LOCK_HANDLE *lock);
#endif
-
#ifndef tw_osl_get_local_time
/* Get local time. */
extern TW_TIME tw_osl_get_local_time(TW_VOID);
#endif
-
#ifndef tw_osl_get_lock
/* Acquire a lock. */
extern TW_VOID tw_osl_get_lock(struct tw_cl_ctlr_handle *ctlr_handle,
TW_LOCK_HANDLE *lock);
#endif
-
#ifndef tw_osl_init_lock
/* Create/initialize a lock for CL's use. */
extern TW_VOID tw_osl_init_lock(struct tw_cl_ctlr_handle *ctlr_handle,
TW_INT8 *lock_name, TW_LOCK_HANDLE *lock);
#endif
-
#ifndef tw_osl_memcpy
/* Copy 'size' bytes from 'src' to 'dest'. */
extern TW_VOID tw_osl_memcpy(TW_VOID *src, TW_VOID *dest, TW_INT32 size);
#endif
-
#ifndef tw_osl_memzero
/* Zero 'size' bytes starting at 'addr'. */
extern TW_VOID tw_osl_memzero(TW_VOID *addr, TW_INT32 size);
#endif
-
#ifndef tw_osl_notify_event
/* Notify OSL of a controller/CL (or even OSL) event. */
extern TW_VOID tw_osl_notify_event(struct tw_cl_ctlr_handle *ctlr_handle,
struct tw_cl_event_packet *event);
#endif
-
#ifdef TW_OSL_PCI_CONFIG_ACCESSIBLE
#ifndef tw_osl_read_pci_config
/* Read 'size' bytes from 'offset' in the PCI config space. */
@@ -444,20 +397,17 @@ extern TW_UINT32 tw_osl_read_pci_config(
#endif
#endif /* TW_OSL_PCI_CONFIG_ACCESSIBLE */
-
#ifndef tw_osl_read_reg
/* Read 'size' bytes at 'offset' from base address of this controller. */
extern TW_UINT32 tw_osl_read_reg(struct tw_cl_ctlr_handle *ctlr_handle,
TW_INT32 offset, TW_INT32 size);
#endif
-
#ifndef tw_osl_scan_bus
/* Request OSL for a bus scan. */
extern TW_VOID tw_osl_scan_bus(struct tw_cl_ctlr_handle *ctlr_handle);
#endif
-
#ifdef TW_OSL_CAN_SLEEP
#ifndef tw_osl_sleep
/* Sleep for 'timeout' ms or until woken up (by tw_osl_wakeup). */
@@ -466,19 +416,16 @@ extern TW_INT32 tw_osl_sleep(struct tw_cl_ctlr_handle *ctlr_handle,
#endif
#endif /* TW_OSL_CAN_SLEEP */
-
#ifndef tw_osl_sprintf
/* Standard sprintf. */
extern TW_INT32 tw_osl_sprintf(TW_INT8 *dest, const TW_INT8 *fmt, ...);
#endif
-
#ifndef tw_osl_strcpy
/* Copy string 'src' to 'dest'. */
extern TW_INT8 *tw_osl_strcpy(TW_INT8 *dest, TW_INT8 *src);
#endif
-
#ifndef tw_osl_strlen
/* Return length of string pointed at by 'str'. */
extern TW_INT32 tw_osl_strlen(TW_VOID *str);
@@ -489,7 +436,6 @@ extern TW_INT32 tw_osl_strlen(TW_VOID *str);
extern TW_INT32 tw_osl_vsprintf(TW_INT8 *dest, const TW_INT8 *fmt, va_list ap);
#endif
-
#ifdef TW_OSL_CAN_SLEEP
#ifndef tw_osl_wakeup
/* Wake up a thread sleeping by a call to tw_osl_sleep. */
@@ -498,7 +444,6 @@ extern TW_VOID tw_osl_wakeup(struct tw_cl_ctlr_handle *ctlr_handle,
#endif
#endif /* TW_OSL_CAN_SLEEP */
-
#ifdef TW_OSL_PCI_CONFIG_ACCESSIBLE
#ifndef tw_osl_write_pci_config
/* Write 'value' of 'size' bytes at 'offset' in the PCI config space. */
@@ -507,7 +452,6 @@ extern TW_VOID tw_osl_write_pci_config(struct tw_cl_ctlr_handle *ctlr_handle,
#endif
#endif /* TW_OSL_PCI_CONFIG_ACCESSIBLE */
-
#ifndef tw_osl_write_reg
/*
* Write 'value' of 'size' (max 4) bytes at 'offset' from base address of
@@ -517,8 +461,6 @@ extern TW_VOID tw_osl_write_reg(struct tw_cl_ctlr_handle *ctlr_handle,
TW_INT32 offset, TW_INT32 value, TW_INT32 size);
#endif
-
-
/* Functions in the Common Layer */
/* Creates and queues AEN's. Also notifies OS Layer. */
@@ -530,12 +472,10 @@ extern TW_VOID tw_cl_create_event(struct tw_cl_ctlr_handle *ctlr_handle,
/* Indicates whether a ctlr is supported by CL. */
extern TW_INT32 tw_cl_ctlr_supported(TW_INT32 vendor_id, TW_INT32 device_id);
-
/* Submit a firmware cmd packet. */
extern TW_INT32 tw_cl_fw_passthru(struct tw_cl_ctlr_handle *ctlr_handle,
struct tw_cl_req_packet *req_pkt, struct tw_cl_req_handle *req_handle);
-
/* Find out how much memory CL needs. */
extern TW_INT32 tw_cl_get_mem_requirements(
struct tw_cl_ctlr_handle *ctlr_handle, TW_UINT32 flags,
@@ -544,12 +484,10 @@ extern TW_INT32 tw_cl_get_mem_requirements(
TW_UINT32 *non_dma_mem_size, TW_UINT32 *dma_mem_size
);
-
/* Return PCI BAR info. */
extern TW_INT32 tw_cl_get_pci_bar_info(TW_INT32 device_id, TW_INT32 bar_type,
TW_INT32 *bar_num, TW_INT32 *bar0_offset, TW_INT32 *bar_size);
-
/* Initialize Common Layer for a given controller. */
extern TW_INT32 tw_cl_init_ctlr(struct tw_cl_ctlr_handle *ctlr_handle,
TW_UINT32 flags, TW_INT32 device_id, TW_INT32 max_simult_reqs,
@@ -557,7 +495,6 @@ extern TW_INT32 tw_cl_init_ctlr(struct tw_cl_ctlr_handle *ctlr_handle,
TW_UINT64 dma_mem_phys
);
-
extern TW_VOID tw_cl_set_reset_needed(struct tw_cl_ctlr_handle *ctlr_handle);
extern TW_INT32 tw_cl_is_reset_needed(struct tw_cl_ctlr_handle *ctlr_handle);
extern TW_INT32 tw_cl_is_active(struct tw_cl_ctlr_handle *ctlr_handle);
@@ -565,12 +502,10 @@ extern TW_INT32 tw_cl_is_active(struct tw_cl_ctlr_handle *ctlr_handle);
/* CL's interrupt handler. */
extern TW_INT32 tw_cl_interrupt(struct tw_cl_ctlr_handle *ctlr_handle);
-
/* CL's ioctl handler. */
extern TW_INT32 tw_cl_ioctl(struct tw_cl_ctlr_handle *ctlr_handle,
u_long cmd, TW_VOID *buf);
-
#ifdef TW_OSL_DEBUG
/* Print CL's state/statistics for a controller. */
extern TW_VOID tw_cl_print_ctlr_stats(struct tw_cl_ctlr_handle *ctlr_handle);
@@ -579,27 +514,22 @@ extern TW_VOID tw_cl_print_ctlr_stats(struct tw_cl_ctlr_handle *ctlr_handle);
extern TW_VOID tw_cl_print_req_info(struct tw_cl_req_handle *req_handle);
#endif /* TW_OSL_DEBUG */
-
/* Soft reset controller. */
extern TW_INT32 tw_cl_reset_ctlr(struct tw_cl_ctlr_handle *ctlr_handle);
-
#ifdef TW_OSL_DEBUG
/* Reset CL's statistics for a controller. */
extern TW_VOID tw_cl_reset_stats(struct tw_cl_ctlr_handle *ctlr_handle);
#endif /* TW_OSL_DEBUG */
-
/* Stop a controller. */
extern TW_INT32 tw_cl_shutdown_ctlr(struct tw_cl_ctlr_handle *ctlr_handle,
TW_UINT32 flags);
-
/* Submit a SCSI I/O request. */
extern TW_INT32 tw_cl_start_io(struct tw_cl_ctlr_handle *ctlr_handle,
struct tw_cl_req_packet *req_pkt, struct tw_cl_req_handle *req_handle);
-
#endif /* TW_BUILDING_API */
#endif /* TW_CL_SHARE_H */
diff --git a/sys/dev/twa/tw_osl.h b/sys/dev/twa/tw_osl.h
index 0c7cfd5b5c2b2..d6b4682bd55f4 100644
--- a/sys/dev/twa/tw_osl.h
+++ b/sys/dev/twa/tw_osl.h
@@ -37,18 +37,14 @@
* Modifications by: Manjunath Ranganathaiah
*/
-
-
#ifndef TW_OSL_H
#define TW_OSL_H
-
/*
* OS Layer internal macros, structures and functions.
*/
-
#define TW_OSLI_DEVICE_NAME "3ware 9000 series Storage Controller"
#define TW_OSLI_MALLOC_CLASS M_TWA
@@ -82,7 +78,6 @@
#define TW_OSLI_REQ_FLAGS_FAILED (1<<7) /* bus_dmamap_load() failed */
#define TW_OSLI_REQ_FLAGS_CCB (1<<8) /* req is ccb. */
-
#ifdef TW_OSL_DEBUG
struct tw_osli_q_stats {
TW_UINT32 cur_len; /* current # of items in q */
@@ -90,7 +85,6 @@ struct tw_osli_q_stats {
};
#endif /* TW_OSL_DEBUG */
-
/* Queues of OSL internal request context packets. */
#define TW_OSLI_FREE_Q 0 /* free q */
#define TW_OSLI_BUSY_Q 1 /* q of reqs submitted to CL */
@@ -127,7 +121,6 @@ struct tw_osli_req_context {
struct tw_cl_req_packet req_pkt;/* req pkt understood by CL */
};
-
/* Per-controller structure. */
struct twa_softc {
struct tw_cl_ctlr_handle ctlr_handle;
@@ -187,8 +180,6 @@ struct twa_softc {
associated with this controller */
};
-
-
/*
* Queue primitives.
*/
@@ -200,7 +191,6 @@ struct twa_softc {
(sc)->q_stats[q_type].max_len = 0; \
} while(0)
-
#define TW_OSLI_Q_INSERT(sc, q_type) do { \
struct tw_osli_q_stats *q_stats = &((sc)->q_stats[q_type]); \
\
@@ -208,11 +198,9 @@ struct twa_softc {
q_stats->max_len = q_stats->cur_len; \
} while(0)
-
#define TW_OSLI_Q_REMOVE(sc, q_type) \
(sc)->q_stats[q_type].cur_len--
-
#else /* TW_OSL_DEBUG */
#define TW_OSLI_Q_INIT(sc, q_index)
@@ -221,8 +209,6 @@ struct twa_softc {
#endif /* TW_OSL_DEBUG */
-
-
/* Initialize a queue of requests. */
static __inline TW_VOID
tw_osli_req_q_init(struct twa_softc *sc, TW_UINT8 q_type)
@@ -231,8 +217,6 @@ tw_osli_req_q_init(struct twa_softc *sc, TW_UINT8 q_type)
TW_OSLI_Q_INIT(sc, q_type);
}
-
-
/* Insert the given request at the head of the given queue (q_type). */
static __inline TW_VOID
tw_osli_req_q_insert_head(struct tw_osli_req_context *req, TW_UINT8 q_type)
@@ -243,8 +227,6 @@ tw_osli_req_q_insert_head(struct tw_osli_req_context *req, TW_UINT8 q_type)
mtx_unlock_spin(req->ctlr->q_lock);
}
-
-
/* Insert the given request at the tail of the given queue (q_type). */
static __inline TW_VOID
tw_osli_req_q_insert_tail(struct tw_osli_req_context *req, TW_UINT8 q_type)
@@ -255,8 +237,6 @@ tw_osli_req_q_insert_tail(struct tw_osli_req_context *req, TW_UINT8 q_type)
mtx_unlock_spin(req->ctlr->q_lock);
}
-
-
/* Remove and return the request at the head of the given queue (q_type). */
static __inline struct tw_osli_req_context *
tw_osli_req_q_remove_head(struct twa_softc *sc, TW_UINT8 q_type)
@@ -276,8 +256,6 @@ tw_osli_req_q_remove_head(struct twa_softc *sc, TW_UINT8 q_type)
return(req);
}
-
-
/* Remove the given request from the given queue (q_type). */
static __inline TW_VOID
tw_osli_req_q_remove_item(struct tw_osli_req_context *req, TW_UINT8 q_type)
@@ -288,8 +266,6 @@ tw_osli_req_q_remove_item(struct tw_osli_req_context *req, TW_UINT8 q_type)
mtx_unlock_spin(req->ctlr->q_lock);
}
-
-
#ifdef TW_OSL_DEBUG
extern TW_INT32 TW_DEBUG_LEVEL_FOR_OSL;
@@ -299,7 +275,6 @@ extern TW_INT32 TW_DEBUG_LEVEL_FOR_OSL;
device_printf(sc->bus_dev, "%s: " fmt "\n", \
__func__, ##args)
-
#define tw_osli_dbg_printf(dbg_level, fmt, args...) \
if (dbg_level <= TW_DEBUG_LEVEL_FOR_OSL) \
printf("%s: " fmt "\n", __func__, ##args)
@@ -311,7 +286,6 @@ extern TW_INT32 TW_DEBUG_LEVEL_FOR_OSL;
#endif /* TW_OSL_DEBUG */
-
/* For regular printing. */
#define twa_printf(sc, fmt, args...) \
device_printf(((struct twa_softc *)(sc))->bus_dev, fmt, ##args)
@@ -321,6 +295,4 @@ extern TW_INT32 TW_DEBUG_LEVEL_FOR_OSL;
device_printf((sc)->bus_dev, \
"%s: (0x%02X: 0x%04X): %s: " err_specific_desc "\n", ##args)
-
-
#endif /* TW_OSL_H */
diff --git a/sys/dev/twa/tw_osl_cam.c b/sys/dev/twa/tw_osl_cam.c
index d54ad55e42866..6e30c930f2937 100644
--- a/sys/dev/twa/tw_osl_cam.c
+++ b/sys/dev/twa/tw_osl_cam.c
@@ -37,12 +37,10 @@
* Modifications by: Manjunath Ranganathaiah
*/
-
/*
* FreeBSD CAM related functions.
*/
-
#include <dev/twa/tw_osl_includes.h>
#include <cam/cam.h>
@@ -61,8 +59,6 @@ static TW_VOID twa_poll(struct cam_sim *sim);
static TW_INT32 tw_osli_execute_scsi(struct tw_osli_req_context *req,
union ccb *ccb);
-
-
/*
* Function name: tw_osli_cam_attach
* Description: Attaches the driver to CAM.
@@ -154,8 +150,6 @@ tw_osli_cam_attach(struct twa_softc *sc)
return(0);
}
-
-
/*
* Function name: tw_osli_cam_detach
* Description: Detaches the driver from CAM.
@@ -182,8 +176,6 @@ tw_osli_cam_detach(struct twa_softc *sc)
mtx_destroy(sc->sim_lock);
}
-
-
/*
* Function name: tw_osli_execute_scsi
* Description: Build a fw cmd, based on a CAM style ccb, and
@@ -300,8 +292,6 @@ tw_osli_execute_scsi(struct tw_osli_req_context *req, union ccb *ccb)
return(error);
}
-
-
/*
* Function name: twa_action
* Description: Driver entry point for CAM's use.
@@ -447,8 +437,6 @@ twa_action(struct cam_sim *sim, union ccb *ccb)
}
}
-
-
/*
* Function name: twa_poll
* Description: Driver entry point called when interrupts are not
@@ -468,8 +456,6 @@ twa_poll(struct cam_sim *sim)
tw_osli_dbg_dprintf(3, sc, "exiting; sc = %p", sc);
}
-
-
/*
* Function name: tw_osli_request_bus_scan
* Description: Requests CAM for a scan of the bus.
@@ -504,8 +490,6 @@ tw_osli_request_bus_scan(struct twa_softc *sc)
return(0);
}
-
-
/*
* Function name: tw_osli_disallow_new_requests
* Description: Calls the appropriate CAM function, so as to freeze
@@ -530,8 +514,6 @@ tw_osli_disallow_new_requests(struct twa_softc *sc,
}
}
-
-
/*
* Function name: tw_osl_timeout
* Description: Call to timeout().
@@ -550,8 +532,6 @@ tw_osl_timeout(struct tw_cl_req_handle *req_handle)
req->deadline = tw_osl_get_local_time() + (ccb_h->timeout / 1000);
}
-
-
/*
* Function name: tw_osl_untimeout
* Description: Inverse of call to timeout().
@@ -568,8 +548,6 @@ tw_osl_untimeout(struct tw_cl_req_handle *req_handle)
req->deadline = 0;
}
-
-
/*
* Function name: tw_osl_scan_bus
* Description: CL calls this function to request for a bus scan.
@@ -593,8 +571,6 @@ tw_osl_scan_bus(struct tw_cl_ctlr_handle *ctlr_handle)
error);
}
-
-
/*
* Function name: tw_osl_complete_io
* Description: Called to complete CAM scsi requests.
@@ -685,4 +661,3 @@ tw_osl_complete_io(struct tw_cl_req_handle *req_handle)
/* twa_action will free the request otherwise */
tw_osli_req_q_insert_tail(req, TW_OSLI_FREE_Q);
}
-
diff --git a/sys/dev/twa/tw_osl_externs.h b/sys/dev/twa/tw_osl_externs.h
index bd8250312c5e7..31dc33002f7b1 100644
--- a/sys/dev/twa/tw_osl_externs.h
+++ b/sys/dev/twa/tw_osl_externs.h
@@ -36,24 +36,18 @@
* Modifications by: Adam Radford
*/
-
-
#ifndef TW_OSL_EXTERNS_H
#define TW_OSL_EXTERNS_H
-
/*
* Data structures and functions global to the OS Layer.
*/
-
/* External data structures. */
extern int mp_ncpus;
-
-
/* Functions in tw_osl_freebsd.c */
/* Build a firmware passthru cmd pkt, and submit it to CL. */
@@ -68,8 +62,6 @@ extern TW_INT32 tw_osli_map_request(struct tw_osli_req_context *req);
/* Undo mapping. */
extern TW_VOID tw_osli_unmap_request(struct tw_osli_req_context *req);
-
-
/* Functions in tw_osl_cam.c */
/* Attach to CAM. */
@@ -91,6 +83,4 @@ extern TW_VOID tw_osl_complete_io(struct tw_cl_req_handle *req_handle);
/* OSL's completion routine for passthru requests. */
extern TW_VOID tw_osl_complete_passthru(struct tw_cl_req_handle *req_handle);
-
-
#endif /* TW_OSL_EXTERNS_H */
diff --git a/sys/dev/twa/tw_osl_freebsd.c b/sys/dev/twa/tw_osl_freebsd.c
index c330b342ba40f..6b76f424650ab 100644
--- a/sys/dev/twa/tw_osl_freebsd.c
+++ b/sys/dev/twa/tw_osl_freebsd.c
@@ -40,13 +40,11 @@ __FBSDID("$FreeBSD$");
* Modifications by: Manjunath Ranganathaiah
*/
-
/*
* FreeBSD specific functions not related to CAM, and other
* miscellaneous functions.
*/
-
#include <dev/twa/tw_osl_includes.h>
#include <dev/twa/tw_cl_fwif.h>
#include <dev/twa/tw_cl_ioctl.h>
@@ -59,7 +57,6 @@ TW_INT32 TW_OSL_DEBUG_LEVEL_FOR_CL = TW_OSL_DEBUG;
static MALLOC_DEFINE(TW_OSLI_MALLOC_CLASS, "twa_commands", "twa commands");
-
static d_open_t twa_open;
static d_close_t twa_close;
static d_ioctl_t twa_ioctl;
@@ -74,7 +71,6 @@ static struct cdevsw twa_cdevsw = {
static devclass_t twa_devclass;
-
/*
* Function name: twa_open
* Description: Called when the controller is opened.
@@ -98,8 +94,6 @@ twa_open(struct cdev *dev, TW_INT32 flags, TW_INT32 fmt, struct thread *proc)
return(0);
}
-
-
/*
* Function name: twa_close
* Description: Called when the controller is closed.
@@ -123,8 +117,6 @@ twa_close(struct cdev *dev, TW_INT32 flags, TW_INT32 fmt, struct thread *proc)
return(0);
}
-
-
/*
* Function name: twa_ioctl
* Description: Called when an ioctl is posted to the controller.
@@ -170,8 +162,6 @@ twa_ioctl(struct cdev *dev, u_long cmd, caddr_t buf, TW_INT32 flags, struct thre
return(error);
}
-
-
static TW_INT32 twa_probe(device_t dev);
static TW_INT32 twa_attach(device_t dev);
static TW_INT32 twa_detach(device_t dev);
@@ -190,7 +180,6 @@ static TW_VOID twa_map_load_data_callback(TW_VOID *arg,
static TW_VOID twa_map_load_callback(TW_VOID *arg,
bus_dma_segment_t *segs, TW_INT32 nsegments, TW_INT32 error);
-
static device_method_t twa_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, twa_probe),
@@ -211,7 +200,6 @@ DRIVER_MODULE(twa, pci, twa_pci_driver, twa_devclass, 0, 0);
MODULE_DEPEND(twa, cam, 1, 1, 1);
MODULE_DEPEND(twa, pci, 1, 1, 1);
-
/*
* Function name: twa_probe
* Description: Called at driver load time. Claims 9000 ctlrs.
@@ -255,7 +243,6 @@ int twa_setup_intr(struct twa_softc *sc)
return( error );
}
-
int twa_teardown_intr(struct twa_softc *sc)
{
int error = 0;
@@ -268,8 +255,6 @@ int twa_teardown_intr(struct twa_softc *sc)
return( error );
}
-
-
/*
* Function name: twa_attach
* Description: Allocates pci resources; updates sc; adds a node to the
@@ -433,7 +418,6 @@ twa_attach(device_t dev)
return(0);
}
-
static TW_VOID
twa_watchdog(TW_VOID *arg)
{
@@ -447,7 +431,6 @@ twa_watchdog(TW_VOID *arg)
TW_UINT64 current_time;
struct tw_osli_req_context *my_req;
-
//==============================================================================
current_time = (TW_UINT64) (tw_osl_get_local_time());
@@ -496,7 +479,6 @@ twa_watchdog(TW_VOID *arg)
#endif /* TW_OSL_DEBUG */
}
-
/*
* Function name: tw_osli_alloc_mem
* Description: Allocates memory needed both by CL and OSL.
@@ -679,7 +661,6 @@ tw_osli_alloc_mem(struct twa_softc *sc)
return(ENOMEM);
}
-
/* Initialize request queues. */
tw_osli_req_q_init(sc, TW_OSLI_FREE_Q);
tw_osli_req_q_init(sc, TW_OSLI_BUSY_Q);
@@ -723,8 +704,6 @@ tw_osli_alloc_mem(struct twa_softc *sc)
return(0);
}
-
-
/*
* Function name: tw_osli_free_resources
* Description: Performs clean-up at the time of going down.
@@ -793,7 +772,6 @@ tw_osli_free_resources(struct twa_softc *sc)
tw_osli_dbg_dprintf(1, sc,
"dma_tag_destroy(parent) returned %d", error);
-
/* Disconnect the interrupt handler. */
if ((error = twa_teardown_intr(sc)))
tw_osli_dbg_dprintf(1, sc,
@@ -805,7 +783,6 @@ tw_osli_free_resources(struct twa_softc *sc)
tw_osli_dbg_dprintf(1, sc,
"release_resource(irq) returned %d", error);
-
/* Release the register window mapping. */
if (sc->reg_res != NULL)
if ((error = bus_release_resource(sc->bus_dev,
@@ -813,7 +790,6 @@ tw_osli_free_resources(struct twa_softc *sc)
tw_osli_dbg_dprintf(1, sc,
"release_resource(io) returned %d", error);
-
/* Destroy the control device. */
if (sc->ctrl_dev != (struct cdev *)NULL)
destroy_dev(sc->ctrl_dev);
@@ -824,8 +800,6 @@ tw_osli_free_resources(struct twa_softc *sc)
}
-
-
/*
* Function name: twa_detach
* Description: Called when the controller is being detached from
@@ -867,8 +841,6 @@ out:
return(error);
}
-
-
/*
* Function name: twa_shutdown
* Description: Called at unload/shutdown time. Lets the controller
@@ -906,8 +878,6 @@ twa_shutdown(device_t dev)
return(error);
}
-
-
/*
* Function name: twa_busdma_lock
* Description: Function to provide synchronization during busdma_swi.
@@ -937,7 +907,6 @@ twa_busdma_lock(TW_VOID *lock_arg, bus_dma_lock_op_t op)
}
}
-
/*
* Function name: twa_pci_intr
* Description: Interrupt handler. Wrapper for twa_interrupt.
@@ -955,7 +924,6 @@ twa_pci_intr(TW_VOID *arg)
tw_cl_interrupt(&(sc->ctlr_handle));
}
-
/*
* Function name: tw_osli_fw_passthru
* Description: Builds a fw passthru cmd pkt, and submits it to CL.
@@ -1122,7 +1090,7 @@ tw_osli_fw_passthru(struct twa_softc *sc, TW_INT8 *buf)
0x2019,
"Could not copyout fw_passthru data_buf",
error);
-
+
fw_passthru_err:
if (req_pkt->status == TW_CL_ERR_REQ_BUS_RESET)
@@ -1136,8 +1104,6 @@ fw_passthru_err:
return(error);
}
-
-
/*
* Function name: tw_osl_complete_passthru
* Description: Called to complete passthru requests.
@@ -1220,8 +1186,6 @@ tw_osl_complete_passthru(struct tw_cl_req_handle *req_handle)
}
}
-
-
/*
* Function name: tw_osli_get_request
* Description: Gets a request pkt from the free queue.
@@ -1257,13 +1221,10 @@ tw_osli_get_request(struct twa_softc *sc)
req->orig_req = NULL;
bzero(&(req->req_pkt), sizeof(struct tw_cl_req_packet));
-
}
return(req);
}
-
-
/*
* Function name: twa_map_load_data_callback
* Description: Callback of bus_dmamap_load for the buffer associated
@@ -1370,8 +1331,6 @@ out:
}
}
-
-
/*
* Function name: twa_map_load_callback
* Description: Callback of bus_dmamap_load for the buffer associated
@@ -1392,8 +1351,6 @@ twa_map_load_callback(TW_VOID *arg, bus_dma_segment_t *segs,
*((bus_addr_t *)arg) = segs[0].ds_addr;
}
-
-
/*
* Function name: tw_osli_map_request
* Description: Maps a cmd pkt and data associated with it, into
@@ -1449,7 +1406,7 @@ tw_osli_map_request(struct tw_osli_req_context *req)
return(ENOMEM);
}
}
-
+
/*
* Map the data buffer into bus space and build the SG list.
*/
@@ -1533,8 +1490,6 @@ tw_osli_map_request(struct tw_osli_req_context *req)
return(error);
}
-
-
/*
* Function name: tw_osli_unmap_request
* Description: Undoes the mapping done by tw_osli_map_request.
@@ -1606,8 +1561,6 @@ tw_osli_unmap_request(struct tw_osli_req_context *req)
}
}
-
-
#ifdef TW_OSL_DEBUG
TW_VOID twa_report_stats(TW_VOID);
@@ -1615,7 +1568,6 @@ TW_VOID twa_reset_stats(TW_VOID);
TW_VOID tw_osli_print_ctlr_stats(struct twa_softc *sc);
TW_VOID twa_print_req_info(struct tw_osli_req_context *req);
-
/*
* Function name: twa_report_stats
* Description: For being called from ddb. Calls functions that print
@@ -1637,8 +1589,6 @@ twa_report_stats(TW_VOID)
}
}
-
-
/*
* Function name: tw_osli_print_ctlr_stats
* Description: For being called from ddb. Prints OSL controller stats
@@ -1660,8 +1610,6 @@ tw_osli_print_ctlr_stats(struct twa_softc *sc)
sc->q_stats[TW_OSLI_BUSY_Q].max_len);
}
-
-
/*
* Function name: twa_print_req_info
* Description: For being called from ddb. Calls functions that print
@@ -1688,8 +1636,6 @@ twa_print_req_info(struct tw_osli_req_context *req)
tw_cl_print_req_info(&(req->req_handle));
}
-
-
/*
* Function name: twa_reset_stats
* Description: For being called from ddb.
diff --git a/sys/dev/twa/tw_osl_includes.h b/sys/dev/twa/tw_osl_includes.h
index 06b69f1a95b47..e6811f5df2a7c 100644
--- a/sys/dev/twa/tw_osl_includes.h
+++ b/sys/dev/twa/tw_osl_includes.h
@@ -36,18 +36,14 @@
* Modifications by: Adam Radford
*/
-
-
#ifndef TW_OSL_INCLUDES_H
#define TW_OSL_INCLUDES_H
-
/*
* All header files needed by the OS Layer.
*/
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/malloc.h>
@@ -77,6 +73,4 @@
#include <dev/twa/tw_cl_share.h>
#include <dev/twa/tw_osl_externs.h>
-
-
#endif /* TW_OSL_INCLUDES_H */
diff --git a/sys/dev/twa/tw_osl_inline.h b/sys/dev/twa/tw_osl_inline.h
index 43fe0c72772e8..4fbea07af5086 100644
--- a/sys/dev/twa/tw_osl_inline.h
+++ b/sys/dev/twa/tw_osl_inline.h
@@ -36,22 +36,16 @@
* Modifications by: Adam Radford
*/
-
-
#ifndef TW_OSL_INLINE_H
#define TW_OSL_INLINE_H
-
/*
* Inline functions shared between OSL and CL, and defined by OSL.
*/
-
#include <dev/twa/tw_osl.h>
-
-
/*
* Function name: tw_osl_init_lock
* Description: Initializes a lock.
@@ -64,8 +58,6 @@
#define tw_osl_init_lock(ctlr_handle, lock_name, lock) \
mtx_init(lock, lock_name, NULL, MTX_SPIN)
-
-
/*
* Function name: tw_osl_destroy_lock
* Description: Destroys a previously initialized lock.
@@ -79,8 +71,6 @@
#define tw_osl_destroy_lock(ctlr_handle, lock) \
mtx_destroy(lock)
-
-
/*
* Function name: tw_osl_get_lock
* Description: Acquires the specified lock.
@@ -94,8 +84,6 @@
#define tw_osl_get_lock(ctlr_handle, lock) \
mtx_lock_spin(lock)
-
-
/*
* Function name: tw_osl_free_lock
* Description: Frees a previously acquired lock.
@@ -108,8 +96,6 @@
#define tw_osl_free_lock(ctlr_handle, lock) \
mtx_unlock_spin(lock)
-
-
#ifdef TW_OSL_DEBUG
/*
@@ -128,8 +114,6 @@
#endif /* TW_OSL_DEBUG */
-
-
/*
* Function name: tw_osl_notify_event
* Description: Prints passed event info (prefixed by ctlr name)
@@ -150,8 +134,6 @@
strlen(event->parameter_data) + 1, \
event->parameter_data)
-
-
/*
* Function name: tw_osl_read_reg
* Description: Reads a register on the controller
@@ -183,8 +165,6 @@ tw_osl_read_reg_inline(struct tw_cl_ctlr_handle *ctlr_handle,
offset));
}
-
-
/*
* Function name: tw_osl_write_reg
* Description: Writes to a register on the controller
@@ -214,8 +194,6 @@ tw_osl_write_reg_inline(struct tw_cl_ctlr_handle *ctlr_handle,
bus_space_write_1(bus_tag, bus_handle, offset, (TW_INT8)value);
}
-
-
#ifdef TW_OSL_PCI_CONFIG_ACCESSIBLE
/*
@@ -233,8 +211,6 @@ tw_osl_write_reg_inline(struct tw_cl_ctlr_handle *ctlr_handle,
((struct twa_softc *)(ctlr_handle->osl_ctlr_ctxt))->bus_dev, \
offset, size)
-
-
/*
* Function name: tw_osl_write_pci_config
* Description: Writes to the PCI config space.
@@ -253,8 +229,6 @@ tw_osl_write_reg_inline(struct tw_cl_ctlr_handle *ctlr_handle,
#endif /* TW_OSL_PCI_CONFIG_ACCESSIBLE */
-
-
/*
* Function name: tw_osl_get_local_time
* Description: Gets the local time
@@ -266,7 +240,6 @@ tw_osl_write_reg_inline(struct tw_cl_ctlr_handle *ctlr_handle,
#define tw_osl_get_local_time() \
(time_second - utc_offset())
-
/*
* Function name: tw_osl_delay
* Description: Spin for the specified time
@@ -277,8 +250,6 @@ tw_osl_write_reg_inline(struct tw_cl_ctlr_handle *ctlr_handle,
*/
#define tw_osl_delay(usecs) DELAY(usecs)
-
-
#ifdef TW_OSL_CAN_SLEEP
/*
@@ -296,8 +267,6 @@ tw_osl_write_reg_inline(struct tw_cl_ctlr_handle *ctlr_handle,
#define tw_osl_sleep(ctlr_handle, sleep_handle, timeout) \
tsleep((TW_VOID *)sleep_handle, PRIBIO, NULL, timeout)
-
-
/*
* Function name: tw_osl_wakeup
* Description: Wake up a sleeping process
@@ -313,39 +282,28 @@ tw_osl_write_reg_inline(struct tw_cl_ctlr_handle *ctlr_handle,
#endif /* TW_OSL_CAN_SLEEP */
-
-
/* Allows setting breakpoints in the CL code for debugging purposes. */
#define tw_osl_breakpoint() breakpoint()
-
/* Text name of current function. */
#define tw_osl_cur_func() __func__
-
/* Copy 'size' bytes from 'src' to 'dest'. */
#define tw_osl_memcpy(dest, src, size) bcopy(src, dest, size)
-
/* Zero 'size' bytes starting at 'addr'. */
#define tw_osl_memzero bzero
-
/* Standard sprintf. */
#define tw_osl_sprintf sprintf
-
/* Copy string 'src' to 'dest'. */
#define tw_osl_strcpy strcpy
-
/* Return length of string pointed at by 'str'. */
#define tw_osl_strlen strlen
-
/* Standard vsprintf. */
#define tw_osl_vsprintf vsprintf
-
-
#endif /* TW_OSL_INLINE_H */
diff --git a/sys/dev/twa/tw_osl_ioctl.h b/sys/dev/twa/tw_osl_ioctl.h
index 3d26cbb642da7..6c1673c158a83 100644
--- a/sys/dev/twa/tw_osl_ioctl.h
+++ b/sys/dev/twa/tw_osl_ioctl.h
@@ -36,24 +36,17 @@
* Modifications by: Adam Radford
*/
-
-
#ifndef TW_OSL_IOCTL_H
#define TW_OSL_IOCTL_H
-
/*
* Macros and structures for OS Layer/Common Layer handled ioctls.
*/
-
-
#include <dev/twa/tw_cl_fwif.h>
#include <dev/twa/tw_cl_ioctl.h>
-
-
#pragma pack(1)
/*
* We need the structure below to ensure that the first byte of
@@ -78,7 +71,6 @@ typedef struct tw_osli_ioctl_no_data_buf {
#define TW_OSL_IOCTL_FIRMWARE_PASS_THROUGH \
_IOWR('T', 202, TW_OSLI_IOCTL_NO_DATA_BUF)
-
#include <sys/ioccom.h>
#pragma pack(1)
@@ -113,6 +105,4 @@ typedef struct tw_osli_ioctl_with_payload {
#define TW_CL_IOCTL_GET_COMPATIBILITY_INFO \
_IOWR('T', 209, TW_OSLI_IOCTL_WITH_PAYLOAD)
-
-
#endif /* TW_OSL_IOCTL_H */
diff --git a/sys/dev/twa/tw_osl_share.h b/sys/dev/twa/tw_osl_share.h
index 13f2a62eba7f2..0e5ee02e300c7 100644
--- a/sys/dev/twa/tw_osl_share.h
+++ b/sys/dev/twa/tw_osl_share.h
@@ -36,19 +36,15 @@
* Modifications by: Adam Radford
*/
-
-
#ifndef TW_OSL_SHARE_H
#define TW_OSL_SHARE_H
-
/*
* Macros, structures and functions shared between OSL and CL,
* and defined by OSL.
*/
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
@@ -68,7 +64,6 @@
#include <dev/twa/tw_osl_types.h>
#include "opt_twa.h"
-
#ifdef TWA_DEBUG
#define TW_OSL_DEBUG TWA_DEBUG
#endif
@@ -97,7 +92,6 @@ typedef TW_VOID *TW_SLEEP_HANDLE;
extern TW_INT32 TW_OSL_DEBUG_LEVEL_FOR_CL;
#endif /* TW_OSL_DEBUG */
-
/* Possible return codes from/to Common Layer functions. */
#define TW_OSL_ESUCCESS 0 /* success */
#define TW_OSL_EGENFAILURE 1 /* general failure */
@@ -110,6 +104,4 @@ extern TW_INT32 TW_OSL_DEBUG_LEVEL_FOR_CL;
#define TW_OSL_EWOULDBLOCK EWOULDBLOCK /* sleep timed out */
#define TW_OSL_ERESTART ERESTART /* sleep terminated by a signal */
-
-
#endif /* TW_OSL_SHARE_H */
diff --git a/sys/dev/twa/tw_osl_types.h b/sys/dev/twa/tw_osl_types.h
index 913aca0ccf9a7..d208606e61da2 100644
--- a/sys/dev/twa/tw_osl_types.h
+++ b/sys/dev/twa/tw_osl_types.h
@@ -36,18 +36,14 @@
* Modifications by: Adam Radford
*/
-
-
#ifndef TW_OSL_TYPES_H
#define TW_OSL_TYPES_H
-
/*
* typedefs shared between OSL and CL, and defined by OSL.
*/
-
typedef void TW_VOID;
typedef char TW_INT8;
typedef unsigned char TW_UINT8;
@@ -61,6 +57,4 @@ typedef unsigned long long TW_UINT64;
typedef time_t TW_TIME;
typedef struct mtx TW_LOCK_HANDLE;
-
-
#endif /* TW_OSL_TYPES_H */