aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/advansys.c
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew@wil.cx>2007-10-02 21:55:31 -0400
committerJames Bottomley <jejb@mulgrave.localdomain>2007-10-12 14:53:26 -0400
commitd24114955846c321a9e94fff4764bbef532524b2 (patch)
tree8166e128b3610d8f8fb2d4c34ce6d17b14ef2a7e /drivers/scsi/advansys.c
parent720349a879d3e37f3d932bf3ca9b94ac638d59b6 (diff)
[SCSI] advansys: Remove asc_board_t typedef and ASC_BOARDP macro
asc_board_t was simply a typedef for struct asc_board. ASC_BOARDP() can be replaced by shost_priv() except in the ASC_STATS* macros which rely on the cast; add an explicit cast there. Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/advansys.c')
-rw-r--r--drivers/scsi/advansys.c132
1 files changed, 51 insertions, 81 deletions
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index 0f309e80aaad..7570380dc958 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -2203,10 +2203,7 @@ do { \
2203 (sizeof(ADV_SG_BLOCK) * \ 2203 (sizeof(ADV_SG_BLOCK) * \
2204 ((ADV_MAX_SG_LIST + (NO_OF_SG_PER_BLOCK - 1))/NO_OF_SG_PER_BLOCK)) 2204 ((ADV_MAX_SG_LIST + (NO_OF_SG_PER_BLOCK - 1))/NO_OF_SG_PER_BLOCK))
2205 2205
2206/* Reference Scsi_Host hostdata */ 2206/* struct asc_board flags */
2207#define ASC_BOARDP(host) ((asc_board_t *) &((host)->hostdata))
2208
2209/* asc_board_t flags */
2210#define ASC_IS_WIDE_BOARD 0x04 /* AdvanSys Wide Board */ 2207#define ASC_IS_WIDE_BOARD 0x04 /* AdvanSys Wide Board */
2211 2208
2212#define ASC_NARROW_BOARD(boardp) (((boardp)->flags & ASC_IS_WIDE_BOARD) == 0) 2209#define ASC_NARROW_BOARD(boardp) (((boardp)->flags & ASC_IS_WIDE_BOARD) == 0)
@@ -2244,15 +2241,12 @@ do { \
2244#define HOST_BYTE(byte) ((byte) << 16) 2241#define HOST_BYTE(byte) ((byte) << 16)
2245#define DRIVER_BYTE(byte) ((byte) << 24) 2242#define DRIVER_BYTE(byte) ((byte) << 24)
2246 2243
2244#define ASC_STATS(shost, counter) ASC_STATS_ADD(shost, counter, 1)
2247#ifndef ADVANSYS_STATS 2245#ifndef ADVANSYS_STATS
2248#define ASC_STATS(shost, counter)
2249#define ASC_STATS_ADD(shost, counter, count) 2246#define ASC_STATS_ADD(shost, counter, count)
2250#else /* ADVANSYS_STATS */ 2247#else /* ADVANSYS_STATS */
2251#define ASC_STATS(shost, counter) \
2252 (ASC_BOARDP(shost)->asc_stats.counter++)
2253
2254#define ASC_STATS_ADD(shost, counter, count) \ 2248#define ASC_STATS_ADD(shost, counter, count) \
2255 (ASC_BOARDP(shost)->asc_stats.counter += (count)) 2249 (((struct asc_board *) shost_priv(shost))->asc_stats.counter += (count))
2256#endif /* ADVANSYS_STATS */ 2250#endif /* ADVANSYS_STATS */
2257 2251
2258#define ASC_CEILING(val, unit) (((val) + ((unit) - 1))/(unit)) 2252#define ASC_CEILING(val, unit) (((val) + ((unit) - 1))/(unit))
@@ -2475,7 +2469,7 @@ typedef struct adv_req {
2475 * of the 'Scsi_Host' structure starting at the 'hostdata' 2469 * of the 'Scsi_Host' structure starting at the 'hostdata'
2476 * field. It is guaranteed to be allocated from DMA-able memory. 2470 * field. It is guaranteed to be allocated from DMA-able memory.
2477 */ 2471 */
2478typedef struct asc_board { 2472struct asc_board {
2479 struct device *dev; 2473 struct device *dev;
2480 int id; /* Board Id */ 2474 int id; /* Board Id */
2481 uint flags; /* Board flags */ 2475 uint flags; /* Board flags */
@@ -2523,7 +2517,7 @@ typedef struct asc_board {
2523 ushort bios_version; /* BIOS Version. */ 2517 ushort bios_version; /* BIOS Version. */
2524 ushort bios_codeseg; /* BIOS Code Segment. */ 2518 ushort bios_codeseg; /* BIOS Code Segment. */
2525 ushort bios_codelen; /* BIOS Code Segment Length. */ 2519 ushort bios_codelen; /* BIOS Code Segment Length. */
2526} asc_board_t; 2520};
2527 2521
2528#define adv_dvc_to_board(adv_dvc) container_of(adv_dvc, struct asc_board, \ 2522#define adv_dvc_to_board(adv_dvc) container_of(adv_dvc, struct asc_board, \
2529 dvc_var.adv_dvc_var) 2523 dvc_var.adv_dvc_var)
@@ -2543,9 +2537,7 @@ static int asc_dbglvl = 3;
2543 */ 2537 */
2544static void asc_prt_scsi_host(struct Scsi_Host *s) 2538static void asc_prt_scsi_host(struct Scsi_Host *s)
2545{ 2539{
2546 asc_board_t *boardp; 2540 struct asc_board *boardp = shost_priv(s);
2547
2548 boardp = ASC_BOARDP(s);
2549 2541
2550 printk("Scsi_Host at addr 0x%lx\n", (ulong)s); 2542 printk("Scsi_Host at addr 0x%lx\n", (ulong)s);
2551 printk(" host_busy %u, host_no %d, last_reset %d,\n", 2543 printk(" host_busy %u, host_no %d, last_reset %d,\n",
@@ -2561,11 +2553,11 @@ static void asc_prt_scsi_host(struct Scsi_Host *s)
2561 s->cmd_per_lun, s->sg_tablesize, s->unchecked_isa_dma); 2553 s->cmd_per_lun, s->sg_tablesize, s->unchecked_isa_dma);
2562 2554
2563 if (ASC_NARROW_BOARD(boardp)) { 2555 if (ASC_NARROW_BOARD(boardp)) {
2564 asc_prt_asc_dvc_var(&ASC_BOARDP(s)->dvc_var.asc_dvc_var); 2556 asc_prt_asc_dvc_var(boardp->dvc_var.asc_dvc_var);
2565 asc_prt_asc_dvc_cfg(&ASC_BOARDP(s)->dvc_cfg.asc_dvc_cfg); 2557 asc_prt_asc_dvc_cfg(boardp->dvc_cfg.asc_dvc_cfg);
2566 } else { 2558 } else {
2567 asc_prt_adv_dvc_var(&ASC_BOARDP(s)->dvc_var.adv_dvc_var); 2559 asc_prt_adv_dvc_var(boardp->dvc_var.adv_dvc_var);
2568 asc_prt_adv_dvc_cfg(&ASC_BOARDP(s)->dvc_cfg.adv_dvc_cfg); 2560 asc_prt_adv_dvc_cfg(boardp->dvc_cfg.adv_dvc_cfg);
2569 } 2561 }
2570} 2562}
2571 2563
@@ -2914,13 +2906,12 @@ static void asc_prt_hex(char *f, uchar *s, int l)
2914static const char *advansys_info(struct Scsi_Host *shost) 2906static const char *advansys_info(struct Scsi_Host *shost)
2915{ 2907{
2916 static char info[ASC_INFO_SIZE]; 2908 static char info[ASC_INFO_SIZE];
2917 asc_board_t *boardp; 2909 struct asc_board *boardp = shost_priv(shost);
2918 ASC_DVC_VAR *asc_dvc_varp; 2910 ASC_DVC_VAR *asc_dvc_varp;
2919 ADV_DVC_VAR *adv_dvc_varp; 2911 ADV_DVC_VAR *adv_dvc_varp;
2920 char *busname; 2912 char *busname;
2921 char *widename = NULL; 2913 char *widename = NULL;
2922 2914
2923 boardp = ASC_BOARDP(shost);
2924 if (ASC_NARROW_BOARD(boardp)) { 2915 if (ASC_NARROW_BOARD(boardp)) {
2925 asc_dvc_varp = &boardp->dvc_var.asc_dvc_var; 2916 asc_dvc_varp = &boardp->dvc_var.asc_dvc_var;
2926 ASC_DBG(1, "advansys_info: begin\n"); 2917 ASC_DBG(1, "advansys_info: begin\n");
@@ -3032,14 +3023,13 @@ static int asc_prt_line(char *buf, int buflen, char *fmt, ...)
3032 */ 3023 */
3033static int asc_prt_board_devices(struct Scsi_Host *shost, char *cp, int cplen) 3024static int asc_prt_board_devices(struct Scsi_Host *shost, char *cp, int cplen)
3034{ 3025{
3035 asc_board_t *boardp; 3026 struct asc_board *boardp = shost_priv(shost);
3036 int leftlen; 3027 int leftlen;
3037 int totlen; 3028 int totlen;
3038 int len; 3029 int len;
3039 int chip_scsi_id; 3030 int chip_scsi_id;
3040 int i; 3031 int i;
3041 3032
3042 boardp = ASC_BOARDP(shost);
3043 leftlen = cplen; 3033 leftlen = cplen;
3044 totlen = len = 0; 3034 totlen = len = 0;
3045 3035
@@ -3073,13 +3063,12 @@ static int asc_prt_board_devices(struct Scsi_Host *shost, char *cp, int cplen)
3073 */ 3063 */
3074static int asc_prt_adv_bios(struct Scsi_Host *shost, char *cp, int cplen) 3064static int asc_prt_adv_bios(struct Scsi_Host *shost, char *cp, int cplen)
3075{ 3065{
3076 asc_board_t *boardp; 3066 struct asc_board *boardp = shost_priv(shost);
3077 int leftlen; 3067 int leftlen;
3078 int totlen; 3068 int totlen;
3079 int len; 3069 int len;
3080 ushort major, minor, letter; 3070 ushort major, minor, letter;
3081 3071
3082 boardp = ASC_BOARDP(shost);
3083 leftlen = cplen; 3072 leftlen = cplen;
3084 totlen = len = 0; 3073 totlen = len = 0;
3085 3074
@@ -3239,7 +3228,7 @@ static int asc_get_eeprom_string(ushort *serialnum, uchar *cp)
3239 */ 3228 */
3240static int asc_prt_asc_board_eeprom(struct Scsi_Host *shost, char *cp, int cplen) 3229static int asc_prt_asc_board_eeprom(struct Scsi_Host *shost, char *cp, int cplen)
3241{ 3230{
3242 asc_board_t *boardp; 3231 struct asc_board *boardp = shost_priv(shost);
3243 ASC_DVC_VAR *asc_dvc_varp; 3232 ASC_DVC_VAR *asc_dvc_varp;
3244 int leftlen; 3233 int leftlen;
3245 int totlen; 3234 int totlen;
@@ -3251,7 +3240,6 @@ static int asc_prt_asc_board_eeprom(struct Scsi_Host *shost, char *cp, int cplen
3251#endif /* CONFIG_ISA */ 3240#endif /* CONFIG_ISA */
3252 uchar serialstr[13]; 3241 uchar serialstr[13];
3253 3242
3254 boardp = ASC_BOARDP(shost);
3255 asc_dvc_varp = &boardp->dvc_var.asc_dvc_var; 3243 asc_dvc_varp = &boardp->dvc_var.asc_dvc_var;
3256 ep = &boardp->eep_config.asc_eep; 3244 ep = &boardp->eep_config.asc_eep;
3257 3245
@@ -3373,7 +3361,7 @@ static int asc_prt_asc_board_eeprom(struct Scsi_Host *shost, char *cp, int cplen
3373 */ 3361 */
3374static int asc_prt_adv_board_eeprom(struct Scsi_Host *shost, char *cp, int cplen) 3362static int asc_prt_adv_board_eeprom(struct Scsi_Host *shost, char *cp, int cplen)
3375{ 3363{
3376 asc_board_t *boardp; 3364 struct asc_board *boardp = shost_priv(shost);
3377 ADV_DVC_VAR *adv_dvc_varp; 3365 ADV_DVC_VAR *adv_dvc_varp;
3378 int leftlen; 3366 int leftlen;
3379 int totlen; 3367 int totlen;
@@ -3388,7 +3376,6 @@ static int asc_prt_adv_board_eeprom(struct Scsi_Host *shost, char *cp, int cplen
3388 ushort *wordp; 3376 ushort *wordp;
3389 ushort sdtr_speed = 0; 3377 ushort sdtr_speed = 0;
3390 3378
3391 boardp = ASC_BOARDP(shost);
3392 adv_dvc_varp = &boardp->dvc_var.adv_dvc_var; 3379 adv_dvc_varp = &boardp->dvc_var.adv_dvc_var;
3393 if (adv_dvc_varp->chip_type == ADV_CHIP_ASC3550) { 3380 if (adv_dvc_varp->chip_type == ADV_CHIP_ASC3550) {
3394 ep_3550 = &boardp->eep_config.adv_3550_eep; 3381 ep_3550 = &boardp->eep_config.adv_3550_eep;
@@ -3660,14 +3647,12 @@ static int asc_prt_adv_board_eeprom(struct Scsi_Host *shost, char *cp, int cplen
3660 */ 3647 */
3661static int asc_prt_driver_conf(struct Scsi_Host *shost, char *cp, int cplen) 3648static int asc_prt_driver_conf(struct Scsi_Host *shost, char *cp, int cplen)
3662{ 3649{
3663 asc_board_t *boardp; 3650 struct asc_board *boardp = shost_priv(shost);
3664 int leftlen; 3651 int leftlen;
3665 int totlen; 3652 int totlen;
3666 int len; 3653 int len;
3667 int chip_scsi_id; 3654 int chip_scsi_id;
3668 3655
3669 boardp = ASC_BOARDP(shost);
3670
3671 leftlen = cplen; 3656 leftlen = cplen;
3672 totlen = len = 0; 3657 totlen = len = 0;
3673 3658
@@ -3724,7 +3709,7 @@ static int asc_prt_driver_conf(struct Scsi_Host *shost, char *cp, int cplen)
3724 */ 3709 */
3725static int asc_prt_asc_board_info(struct Scsi_Host *shost, char *cp, int cplen) 3710static int asc_prt_asc_board_info(struct Scsi_Host *shost, char *cp, int cplen)
3726{ 3711{
3727 asc_board_t *boardp; 3712 struct asc_board *boardp = shost_priv(shost);
3728 int chip_scsi_id; 3713 int chip_scsi_id;
3729 int leftlen; 3714 int leftlen;
3730 int totlen; 3715 int totlen;
@@ -3734,7 +3719,6 @@ static int asc_prt_asc_board_info(struct Scsi_Host *shost, char *cp, int cplen)
3734 int i; 3719 int i;
3735 int renegotiate = 0; 3720 int renegotiate = 0;
3736 3721
3737 boardp = ASC_BOARDP(shost);
3738 v = &boardp->dvc_var.asc_dvc_var; 3722 v = &boardp->dvc_var.asc_dvc_var;
3739 c = &boardp->dvc_cfg.asc_dvc_cfg; 3723 c = &boardp->dvc_cfg.asc_dvc_cfg;
3740 chip_scsi_id = c->chip_scsi_id; 3724 chip_scsi_id = c->chip_scsi_id;
@@ -3912,7 +3896,7 @@ static int asc_prt_asc_board_info(struct Scsi_Host *shost, char *cp, int cplen)
3912 */ 3896 */
3913static int asc_prt_adv_board_info(struct Scsi_Host *shost, char *cp, int cplen) 3897static int asc_prt_adv_board_info(struct Scsi_Host *shost, char *cp, int cplen)
3914{ 3898{
3915 asc_board_t *boardp; 3899 struct asc_board *boardp = shost_priv(shost);
3916 int leftlen; 3900 int leftlen;
3917 int totlen; 3901 int totlen;
3918 int len; 3902 int len;
@@ -3929,7 +3913,6 @@ static int asc_prt_adv_board_info(struct Scsi_Host *shost, char *cp, int cplen)
3929 ushort period = 0; 3913 ushort period = 0;
3930 int renegotiate = 0; 3914 int renegotiate = 0;
3931 3915
3932 boardp = ASC_BOARDP(shost);
3933 v = &boardp->dvc_var.adv_dvc_var; 3916 v = &boardp->dvc_var.adv_dvc_var;
3934 c = &boardp->dvc_cfg.adv_dvc_cfg; 3917 c = &boardp->dvc_cfg.adv_dvc_cfg;
3935 iop_base = v->iop_base; 3918 iop_base = v->iop_base;
@@ -4192,17 +4175,11 @@ asc_proc_copy(off_t advoffset, off_t offset, char *curbuf, int leftlen,
4192 */ 4175 */
4193static int asc_prt_board_stats(struct Scsi_Host *shost, char *cp, int cplen) 4176static int asc_prt_board_stats(struct Scsi_Host *shost, char *cp, int cplen)
4194{ 4177{
4195 int leftlen; 4178 struct asc_board *boardp = shost_priv(shost);
4196 int totlen; 4179 struct asc_stats *s = &boardp->asc_stats;
4197 int len;
4198 struct asc_stats *s;
4199 asc_board_t *boardp;
4200
4201 leftlen = cplen;
4202 totlen = len = 0;
4203 4180
4204 boardp = ASC_BOARDP(shost); 4181 int leftlen = cplen;
4205 s = &boardp->asc_stats; 4182 int len, totlen = 0;
4206 4183
4207 len = asc_prt_line(cp, leftlen, 4184 len = asc_prt_line(cp, leftlen,
4208 "\nLinux Driver Statistics for AdvanSys SCSI Host %d:\n", 4185 "\nLinux Driver Statistics for AdvanSys SCSI Host %d:\n",
@@ -4309,7 +4286,7 @@ static int
4309advansys_proc_info(struct Scsi_Host *shost, char *buffer, char **start, 4286advansys_proc_info(struct Scsi_Host *shost, char *buffer, char **start,
4310 off_t offset, int length, int inout) 4287 off_t offset, int length, int inout)
4311{ 4288{
4312 asc_board_t *boardp; 4289 struct asc_board *boardp = shost_priv(shost);
4313 char *cp; 4290 char *cp;
4314 int cplen; 4291 int cplen;
4315 int cnt; 4292 int cnt;
@@ -4323,16 +4300,13 @@ advansys_proc_info(struct Scsi_Host *shost, char *buffer, char **start,
4323 /* 4300 /*
4324 * User write not supported. 4301 * User write not supported.
4325 */ 4302 */
4326 if (inout == TRUE) { 4303 if (inout == TRUE)
4327 return (-ENOSYS); 4304 return -ENOSYS;
4328 }
4329 4305
4330 /* 4306 /*
4331 * User read of /proc/scsi/advansys/[0...] file. 4307 * User read of /proc/scsi/advansys/[0...] file.
4332 */ 4308 */
4333 4309
4334 boardp = ASC_BOARDP(shost);
4335
4336 /* Copy read data starting at the beginning of the buffer. */ 4310 /* Copy read data starting at the beginning of the buffer. */
4337 *start = buffer; 4311 *start = buffer;
4338 curbuf = buffer; 4312 curbuf = buffer;
@@ -4477,7 +4451,7 @@ advansys_proc_info(struct Scsi_Host *shost, char *buffer, char **start,
4477 4451
4478static void asc_scsi_done(struct scsi_cmnd *scp) 4452static void asc_scsi_done(struct scsi_cmnd *scp)
4479{ 4453{
4480 struct asc_board *boardp = ASC_BOARDP(scp->device->host); 4454 struct asc_board *boardp = shost_priv(scp->device->host);
4481 4455
4482 if (scp->use_sg) 4456 if (scp->use_sg)
4483 dma_unmap_sg(boardp->dev, 4457 dma_unmap_sg(boardp->dev,
@@ -8376,7 +8350,7 @@ static void adv_async_callback(ADV_DVC_VAR *adv_dvc_varp, uchar code)
8376 */ 8350 */
8377static void adv_isr_callback(ADV_DVC_VAR *adv_dvc_varp, ADV_SCSI_REQ_Q *scsiqp) 8351static void adv_isr_callback(ADV_DVC_VAR *adv_dvc_varp, ADV_SCSI_REQ_Q *scsiqp)
8378{ 8352{
8379 asc_board_t *boardp; 8353 struct asc_board *boardp;
8380 adv_req_t *reqp; 8354 adv_req_t *reqp;
8381 adv_sgblk_t *sgblkp; 8355 adv_sgblk_t *sgblkp;
8382 struct scsi_cmnd *scp; 8356 struct scsi_cmnd *scp;
@@ -8420,7 +8394,7 @@ static void adv_isr_callback(ADV_DVC_VAR *adv_dvc_varp, ADV_SCSI_REQ_Q *scsiqp)
8420 ASC_STATS(shost, callback); 8394 ASC_STATS(shost, callback);
8421 ASC_DBG1(1, "adv_isr_callback: shost 0x%lx\n", (ulong)shost); 8395 ASC_DBG1(1, "adv_isr_callback: shost 0x%lx\n", (ulong)shost);
8422 8396
8423 boardp = ASC_BOARDP(shost); 8397 boardp = shost_priv(shost);
8424 BUG_ON(adv_dvc_varp != &boardp->dvc_var.adv_dvc_var); 8398 BUG_ON(adv_dvc_varp != &boardp->dvc_var.adv_dvc_var);
8425 8399
8426 /* 8400 /*
@@ -8825,7 +8799,7 @@ static int AscIsrChipHalted(ASC_DVC_VAR *asc_dvc)
8825 uchar cur_dvc_qng; 8799 uchar cur_dvc_qng;
8826 uchar asyn_sdtr; 8800 uchar asyn_sdtr;
8827 uchar scsi_status; 8801 uchar scsi_status;
8828 asc_board_t *boardp; 8802 struct asc_board *boardp;
8829 8803
8830 BUG_ON(!asc_dvc->drv_ptr); 8804 BUG_ON(!asc_dvc->drv_ptr);
8831 boardp = asc_dvc->drv_ptr; 8805 boardp = asc_dvc->drv_ptr;
@@ -9346,7 +9320,7 @@ _AscCopyLramScsiDoneQ(PortAddr iop_base,
9346 */ 9320 */
9347static void asc_isr_callback(ASC_DVC_VAR *asc_dvc_varp, ASC_QDONE_INFO *qdonep) 9321static void asc_isr_callback(ASC_DVC_VAR *asc_dvc_varp, ASC_QDONE_INFO *qdonep)
9348{ 9322{
9349 asc_board_t *boardp; 9323 struct asc_board *boardp;
9350 struct scsi_cmnd *scp; 9324 struct scsi_cmnd *scp;
9351 struct Scsi_Host *shost; 9325 struct Scsi_Host *shost;
9352 9326
@@ -9371,7 +9345,7 @@ static void asc_isr_callback(ASC_DVC_VAR *asc_dvc_varp, ASC_QDONE_INFO *qdonep)
9371 ASC_STATS(shost, callback); 9345 ASC_STATS(shost, callback);
9372 ASC_DBG1(1, "asc_isr_callback: shost 0x%lx\n", (ulong)shost); 9346 ASC_DBG1(1, "asc_isr_callback: shost 0x%lx\n", (ulong)shost);
9373 9347
9374 boardp = ASC_BOARDP(shost); 9348 boardp = shost_priv(shost);
9375 BUG_ON(asc_dvc_varp != &boardp->dvc_var.asc_dvc_var); 9349 BUG_ON(asc_dvc_varp != &boardp->dvc_var.asc_dvc_var);
9376 9350
9377 /* 9351 /*
@@ -9727,7 +9701,7 @@ static int AscISR(ASC_DVC_VAR *asc_dvc)
9727static int advansys_reset(struct scsi_cmnd *scp) 9701static int advansys_reset(struct scsi_cmnd *scp)
9728{ 9702{
9729 struct Scsi_Host *shost = scp->device->host; 9703 struct Scsi_Host *shost = scp->device->host;
9730 struct asc_board *boardp = ASC_BOARDP(shost); 9704 struct asc_board *boardp = shost_priv(shost);
9731 unsigned long flags; 9705 unsigned long flags;
9732 int status; 9706 int status;
9733 int ret = SUCCESS; 9707 int ret = SUCCESS;
@@ -9810,11 +9784,10 @@ static int
9810advansys_biosparam(struct scsi_device *sdev, struct block_device *bdev, 9784advansys_biosparam(struct scsi_device *sdev, struct block_device *bdev,
9811 sector_t capacity, int ip[]) 9785 sector_t capacity, int ip[])
9812{ 9786{
9813 asc_board_t *boardp; 9787 struct asc_board *boardp = shost_priv(sdev->host);
9814 9788
9815 ASC_DBG(1, "advansys_biosparam: begin\n"); 9789 ASC_DBG(1, "advansys_biosparam: begin\n");
9816 ASC_STATS(sdev->host, biosparam); 9790 ASC_STATS(sdev->host, biosparam);
9817 boardp = ASC_BOARDP(sdev->host);
9818 if (ASC_NARROW_BOARD(boardp)) { 9791 if (ASC_NARROW_BOARD(boardp)) {
9819 if ((boardp->dvc_var.asc_dvc_var.dvc_cntl & 9792 if ((boardp->dvc_var.asc_dvc_var.dvc_cntl &
9820 ASC_CNTL_BIOS_GT_1GB) && capacity > 0x200000) { 9793 ASC_CNTL_BIOS_GT_1GB) && capacity > 0x200000) {
@@ -9848,7 +9821,7 @@ static irqreturn_t advansys_interrupt(int irq, void *dev_id)
9848{ 9821{
9849 unsigned long flags; 9822 unsigned long flags;
9850 struct Scsi_Host *shost = dev_id; 9823 struct Scsi_Host *shost = dev_id;
9851 asc_board_t *boardp = ASC_BOARDP(shost); 9824 struct asc_board *boardp = shost_priv(shost);
9852 irqreturn_t result = IRQ_NONE; 9825 irqreturn_t result = IRQ_NONE;
9853 9826
9854 ASC_DBG1(2, "advansys_interrupt: boardp 0x%p\n", boardp); 9827 ASC_DBG1(2, "advansys_interrupt: boardp 0x%p\n", boardp);
@@ -10110,7 +10083,7 @@ advansys_wide_slave_configure(struct scsi_device *sdev, ADV_DVC_VAR *adv_dvc)
10110 */ 10083 */
10111static int advansys_slave_configure(struct scsi_device *sdev) 10084static int advansys_slave_configure(struct scsi_device *sdev)
10112{ 10085{
10113 asc_board_t *boardp = ASC_BOARDP(sdev->host); 10086 struct asc_board *boardp = shost_priv(sdev->host);
10114 10087
10115 if (ASC_NARROW_BOARD(boardp)) 10088 if (ASC_NARROW_BOARD(boardp))
10116 advansys_narrow_slave_configure(sdev, 10089 advansys_narrow_slave_configure(sdev,
@@ -10122,7 +10095,7 @@ static int advansys_slave_configure(struct scsi_device *sdev)
10122 return 0; 10095 return 0;
10123} 10096}
10124 10097
10125static int asc_build_req(asc_board_t *boardp, struct scsi_cmnd *scp, 10098static int asc_build_req(struct asc_board *boardp, struct scsi_cmnd *scp,
10126 struct asc_scsi_q *asc_scsi_q) 10099 struct asc_scsi_q *asc_scsi_q)
10127{ 10100{
10128 memset(asc_scsi_q, 0, sizeof(*asc_scsi_q)); 10101 memset(asc_scsi_q, 0, sizeof(*asc_scsi_q));
@@ -10257,7 +10230,7 @@ static int asc_build_req(asc_board_t *boardp, struct scsi_cmnd *scp,
10257 * ADV_ERROR(-1) - SG List creation failed 10230 * ADV_ERROR(-1) - SG List creation failed
10258 */ 10231 */
10259static int 10232static int
10260adv_get_sglist(asc_board_t *boardp, adv_req_t *reqp, struct scsi_cmnd *scp, 10233adv_get_sglist(struct asc_board *boardp, adv_req_t *reqp, struct scsi_cmnd *scp,
10261 int use_sg) 10234 int use_sg)
10262{ 10235{
10263 adv_sgblk_t *sgblkp; 10236 adv_sgblk_t *sgblkp;
@@ -10367,7 +10340,7 @@ adv_get_sglist(asc_board_t *boardp, adv_req_t *reqp, struct scsi_cmnd *scp,
10367 * to little-endian order. 10340 * to little-endian order.
10368 */ 10341 */
10369static int 10342static int
10370adv_build_req(asc_board_t *boardp, struct scsi_cmnd *scp, 10343adv_build_req(struct asc_board *boardp, struct scsi_cmnd *scp,
10371 ADV_SCSI_REQ_Q **adv_scsiqpp) 10344 ADV_SCSI_REQ_Q **adv_scsiqpp)
10372{ 10345{
10373 adv_req_t *reqp; 10346 adv_req_t *reqp;
@@ -11255,7 +11228,7 @@ static int AdvExeScsiQueue(ADV_DVC_VAR *asc_dvc, ADV_SCSI_REQ_Q *scsiq)
11255static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp) 11228static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp)
11256{ 11229{
11257 int ret, err_code; 11230 int ret, err_code;
11258 asc_board_t *boardp = ASC_BOARDP(scp->device->host); 11231 struct asc_board *boardp = shost_priv(scp->device->host);
11259 11232
11260 ASC_DBG1(1, "asc_execute_scsi_cmnd: scp 0x%p\n", scp); 11233 ASC_DBG1(1, "asc_execute_scsi_cmnd: scp 0x%p\n", scp);
11261 11234
@@ -11346,7 +11319,7 @@ static int
11346advansys_queuecommand(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *)) 11319advansys_queuecommand(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *))
11347{ 11320{
11348 struct Scsi_Host *shost = scp->device->host; 11321 struct Scsi_Host *shost = scp->device->host;
11349 asc_board_t *boardp = ASC_BOARDP(shost); 11322 struct asc_board *boardp = shost_priv(shost);
11350 unsigned long flags; 11323 unsigned long flags;
11351 int asc_res, result = 0; 11324 int asc_res, result = 0;
11352 11325
@@ -12094,7 +12067,7 @@ static ushort __devinit AscInitFromEEP(ASC_DVC_VAR *asc_dvc)
12094 return (warn_code); 12067 return (warn_code);
12095} 12068}
12096 12069
12097static int __devinit AscInitGetConfig(asc_board_t *boardp) 12070static int __devinit AscInitGetConfig(struct asc_board *boardp)
12098{ 12071{
12099 ASC_DVC_VAR *asc_dvc = &boardp->dvc_var.asc_dvc_var; 12072 ASC_DVC_VAR *asc_dvc = &boardp->dvc_var.asc_dvc_var;
12100 unsigned short warn_code = 0; 12073 unsigned short warn_code = 0;
@@ -12151,7 +12124,7 @@ static int __devinit AscInitGetConfig(asc_board_t *boardp)
12151 return asc_dvc->err_code; 12124 return asc_dvc->err_code;
12152} 12125}
12153 12126
12154static int __devinit AscInitSetConfig(struct pci_dev *pdev, asc_board_t *boardp) 12127static int __devinit AscInitSetConfig(struct pci_dev *pdev, struct asc_board *boardp)
12155{ 12128{
12156 ASC_DVC_VAR *asc_dvc = &boardp->dvc_var.asc_dvc_var; 12129 ASC_DVC_VAR *asc_dvc = &boardp->dvc_var.asc_dvc_var;
12157 PortAddr iop_base = asc_dvc->iop_base; 12130 PortAddr iop_base = asc_dvc->iop_base;
@@ -13548,7 +13521,7 @@ static int __devinit AdvInitFrom38C1600EEP(ADV_DVC_VAR *asc_dvc)
13548 * then 0 is returned. 13521 * then 0 is returned.
13549 */ 13522 */
13550static int __devinit 13523static int __devinit
13551AdvInitGetConfig(struct pci_dev *pdev, asc_board_t *boardp) 13524AdvInitGetConfig(struct pci_dev *pdev, struct asc_board *boardp)
13552{ 13525{
13553 ADV_DVC_VAR *asc_dvc = &boardp->dvc_var.adv_dvc_var; 13526 ADV_DVC_VAR *asc_dvc = &boardp->dvc_var.adv_dvc_var;
13554 unsigned short warn_code = 0; 13527 unsigned short warn_code = 0;
@@ -13660,7 +13633,7 @@ static struct scsi_host_template advansys_template = {
13660}; 13633};
13661 13634
13662static int __devinit 13635static int __devinit
13663advansys_wide_init_chip(asc_board_t *boardp, ADV_DVC_VAR *adv_dvc_varp) 13636advansys_wide_init_chip(struct asc_board *boardp, ADV_DVC_VAR *adv_dvc_varp)
13664{ 13637{
13665 int req_cnt = 0; 13638 int req_cnt = 0;
13666 adv_req_t *reqp = NULL; 13639 adv_req_t *reqp = NULL;
@@ -13764,7 +13737,7 @@ advansys_wide_init_chip(asc_board_t *boardp, ADV_DVC_VAR *adv_dvc_varp)
13764 return err_code; 13737 return err_code;
13765} 13738}
13766 13739
13767static void advansys_wide_free_mem(asc_board_t *boardp) 13740static void advansys_wide_free_mem(struct asc_board *boardp)
13768{ 13741{
13769 kfree(boardp->carrp); 13742 kfree(boardp->carrp);
13770 boardp->carrp = NULL; 13743 boardp->carrp = NULL;
@@ -13781,12 +13754,11 @@ static int __devinit advansys_board_found(struct Scsi_Host *shost,
13781 unsigned int iop, int bus_type) 13754 unsigned int iop, int bus_type)
13782{ 13755{
13783 struct pci_dev *pdev; 13756 struct pci_dev *pdev;
13784 asc_board_t *boardp; 13757 struct asc_board *boardp = shost_priv(shost);
13785 ASC_DVC_VAR *asc_dvc_varp = NULL; 13758 ASC_DVC_VAR *asc_dvc_varp = NULL;
13786 ADV_DVC_VAR *adv_dvc_varp = NULL; 13759 ADV_DVC_VAR *adv_dvc_varp = NULL;
13787 int share_irq, warn_code, ret; 13760 int share_irq, warn_code, ret;
13788 13761
13789 boardp = ASC_BOARDP(shost);
13790 boardp->id = asc_board_count++; 13762 boardp->id = asc_board_count++;
13791 spin_lock_init(&boardp->lock); 13763 spin_lock_init(&boardp->lock);
13792 pdev = (bus_type == ASC_IS_PCI) ? to_pci_dev(boardp->dev) : NULL; 13764 pdev = (bus_type == ASC_IS_PCI) ? to_pci_dev(boardp->dev) : NULL;
@@ -14282,11 +14254,9 @@ static int __devinit advansys_board_found(struct Scsi_Host *shost,
14282 */ 14254 */
14283static int advansys_release(struct Scsi_Host *shost) 14255static int advansys_release(struct Scsi_Host *shost)
14284{ 14256{
14285 asc_board_t *boardp; 14257 struct asc_board *boardp = shost_priv(shost);
14286
14287 ASC_DBG(1, "advansys_release: begin\n"); 14258 ASC_DBG(1, "advansys_release: begin\n");
14288 scsi_remove_host(shost); 14259 scsi_remove_host(shost);
14289 boardp = ASC_BOARDP(shost);
14290 free_irq(boardp->irq, shost); 14260 free_irq(boardp->irq, shost);
14291 if (shost->dma_channel != NO_ISA_DMA) { 14261 if (shost->dma_channel != NO_ISA_DMA) {
14292 ASC_DBG(1, "advansys_release: free_dma()\n"); 14262 ASC_DBG(1, "advansys_release: free_dma()\n");
@@ -14348,7 +14318,7 @@ static int __devinit advansys_isa_probe(struct device *dev, unsigned int id)
14348 if (!shost) 14318 if (!shost)
14349 goto release_region; 14319 goto release_region;
14350 14320
14351 board = ASC_BOARDP(shost); 14321 board = shost_priv(shost);
14352 board->irq = advansys_isa_irq_no(iop_base); 14322 board->irq = advansys_isa_irq_no(iop_base);
14353 board->dev = dev; 14323 board->dev = dev;
14354 14324
@@ -14431,7 +14401,7 @@ static int __devinit advansys_vlb_probe(struct device *dev, unsigned int id)
14431 if (!shost) 14401 if (!shost)
14432 goto release_region; 14402 goto release_region;
14433 14403
14434 board = ASC_BOARDP(shost); 14404 board = shost_priv(shost);
14435 board->irq = advansys_vlb_irq_no(iop_base); 14405 board->irq = advansys_vlb_irq_no(iop_base);
14436 board->dev = dev; 14406 board->dev = dev;
14437 14407
@@ -14538,7 +14508,7 @@ static int __devinit advansys_eisa_probe(struct device *dev)
14538 if (!shost) 14508 if (!shost)
14539 goto release_region; 14509 goto release_region;
14540 14510
14541 board = ASC_BOARDP(shost); 14511 board = shost_priv(shost);
14542 board->irq = irq; 14512 board->irq = irq;
14543 board->dev = dev; 14513 board->dev = dev;
14544 14514
@@ -14654,7 +14624,7 @@ advansys_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
14654 if (!shost) 14624 if (!shost)
14655 goto release_region; 14625 goto release_region;
14656 14626
14657 board = ASC_BOARDP(shost); 14627 board = shost_priv(shost);
14658 board->irq = pdev->irq; 14628 board->irq = pdev->irq;
14659 board->dev = &pdev->dev; 14629 board->dev = &pdev->dev;
14660 14630