aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew@wil.cx>2007-07-26 11:57:06 -0400
committerJames Bottomley <jejb@mulgrave.localdomain>2007-10-12 14:39:45 -0400
commit895d6b4ca88ecc69b9301675eb220c6a926d8bb1 (patch)
tree2aab4991152ccf8dcdc1ccfedf5fafb202599b49 /drivers/scsi
parent394dbf3f4005622fa52f1805eb950f08ce20f636 (diff)
[SCSI] advansys: Remove library-style callback routines
Convert adv_isr_callback, adv_async_callback and asc_isr_callback into direct calls. Remove the unused asc_exe_callback. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/advansys.c50
1 files changed, 8 insertions, 42 deletions
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index 73d974a15fca..310b92678035 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -1404,17 +1404,12 @@ typedef struct asc_dvc_cfg {
1404 1404
1405struct asc_dvc_var; /* Forward Declaration. */ 1405struct asc_dvc_var; /* Forward Declaration. */
1406 1406
1407typedef void (*ASC_ISR_CALLBACK) (struct asc_dvc_var *, ASC_QDONE_INFO *);
1408typedef int (*ASC_EXE_CALLBACK) (struct asc_dvc_var *, ASC_SCSI_Q *);
1409
1410typedef struct asc_dvc_var { 1407typedef struct asc_dvc_var {
1411 PortAddr iop_base; 1408 PortAddr iop_base;
1412 ushort err_code; 1409 ushort err_code;
1413 ushort dvc_cntl; 1410 ushort dvc_cntl;
1414 ushort bug_fix_cntl; 1411 ushort bug_fix_cntl;
1415 ushort bus_type; 1412 ushort bus_type;
1416 ASC_ISR_CALLBACK isr_callback;
1417 ASC_EXE_CALLBACK exe_callback;
1418 ASC_SCSI_BIT_ID_TYPE init_sdtr; 1413 ASC_SCSI_BIT_ID_TYPE init_sdtr;
1419 ASC_SCSI_BIT_ID_TYPE sdtr_done; 1414 ASC_SCSI_BIT_ID_TYPE sdtr_done;
1420 ASC_SCSI_BIT_ID_TYPE use_tagged_qng; 1415 ASC_SCSI_BIT_ID_TYPE use_tagged_qng;
@@ -2830,12 +2825,6 @@ typedef struct adv_dvc_cfg {
2830struct adv_dvc_var; 2825struct adv_dvc_var;
2831struct adv_scsi_req_q; 2826struct adv_scsi_req_q;
2832 2827
2833typedef void (*ADV_ISR_CALLBACK)
2834 (struct adv_dvc_var *, struct adv_scsi_req_q *);
2835
2836typedef void (*ADV_ASYNC_CALLBACK)
2837 (struct adv_dvc_var *, uchar);
2838
2839/* 2828/*
2840 * Adapter operation variable structure. 2829 * Adapter operation variable structure.
2841 * 2830 *
@@ -2852,8 +2841,6 @@ typedef struct adv_dvc_var {
2852 AdvPortAddr iop_base; /* I/O port address */ 2841 AdvPortAddr iop_base; /* I/O port address */
2853 ushort err_code; /* fatal error code */ 2842 ushort err_code; /* fatal error code */
2854 ushort bios_ctrl; /* BIOS control word, EEPROM word 12 */ 2843 ushort bios_ctrl; /* BIOS control word, EEPROM word 12 */
2855 ADV_ISR_CALLBACK isr_callback;
2856 ADV_ASYNC_CALLBACK async_callback;
2857 ushort wdtr_able; /* try WDTR for a device */ 2844 ushort wdtr_able; /* try WDTR for a device */
2858 ushort sdtr_able; /* try SDTR for a device */ 2845 ushort sdtr_able; /* try SDTR for a device */
2859 ushort ultra_able; /* try SDTR Ultra speed for a device */ 2846 ushort ultra_able; /* try SDTR Ultra speed for a device */
@@ -3671,9 +3658,6 @@ static int asc_execute_scsi_cmnd(struct scsi_cmnd *);
3671static int asc_build_req(asc_board_t *, struct scsi_cmnd *); 3658static int asc_build_req(asc_board_t *, struct scsi_cmnd *);
3672static int adv_build_req(asc_board_t *, struct scsi_cmnd *, ADV_SCSI_REQ_Q **); 3659static int adv_build_req(asc_board_t *, struct scsi_cmnd *, ADV_SCSI_REQ_Q **);
3673static int adv_get_sglist(asc_board_t *, adv_req_t *, struct scsi_cmnd *, int); 3660static int adv_get_sglist(asc_board_t *, adv_req_t *, struct scsi_cmnd *, int);
3674static void asc_isr_callback(ASC_DVC_VAR *, ASC_QDONE_INFO *);
3675static void adv_isr_callback(ADV_DVC_VAR *, ADV_SCSI_REQ_Q *);
3676static void adv_async_callback(ADV_DVC_VAR *, uchar);
3677static void asc_enqueue(asc_queue_t *, REQP, int); 3661static void asc_enqueue(asc_queue_t *, REQP, int);
3678static REQP asc_dequeue(asc_queue_t *, int); 3662static REQP asc_dequeue(asc_queue_t *, int);
3679static REQP asc_dequeue_list(asc_queue_t *, REQP *, int); 3663static REQP asc_dequeue_list(asc_queue_t *, REQP *, int);
@@ -7624,9 +7608,8 @@ static void asc_prt_asc_dvc_var(ASC_DVC_VAR *h)
7624 printk(" iop_base 0x%x, err_code 0x%x, dvc_cntl 0x%x, bug_fix_cntl " 7608 printk(" iop_base 0x%x, err_code 0x%x, dvc_cntl 0x%x, bug_fix_cntl "
7625 "%d,\n", h->iop_base, h->err_code, h->dvc_cntl, h->bug_fix_cntl); 7609 "%d,\n", h->iop_base, h->err_code, h->dvc_cntl, h->bug_fix_cntl);
7626 7610
7627 printk(" bus_type %d, isr_callback 0x%p, exe_callback 0x%p, " 7611 printk(" bus_type %d, init_sdtr 0x%x,\n", h->bus_type,
7628 "init_sdtr 0x%x,\n", h->bus_type, h->isr_callback, 7612 (unsigned)h->init_sdtr);
7629 h->exe_callback, (unsigned)h->init_sdtr);
7630 7613
7631 printk(" sdtr_done 0x%x, use_tagged_qng 0x%x, unit_not_ready 0x%x, " 7614 printk(" sdtr_done 0x%x, use_tagged_qng 0x%x, unit_not_ready 0x%x, "
7632 "chip_no 0x%x,\n", (unsigned)h->sdtr_done, 7615 "chip_no 0x%x,\n", (unsigned)h->sdtr_done,
@@ -8631,10 +8614,8 @@ static int AscIsrQDone(ASC_DVC_VAR *asc_dvc)
8631 ASC_QDONE_INFO scsiq_buf; 8614 ASC_QDONE_INFO scsiq_buf;
8632 ASC_QDONE_INFO *scsiq; 8615 ASC_QDONE_INFO *scsiq;
8633 int false_overrun; 8616 int false_overrun;
8634 ASC_ISR_CALLBACK asc_isr_callback;
8635 8617
8636 iop_base = asc_dvc->iop_base; 8618 iop_base = asc_dvc->iop_base;
8637 asc_isr_callback = asc_dvc->isr_callback;
8638 n_q_used = 1; 8619 n_q_used = 1;
8639 scsiq = (ASC_QDONE_INFO *)&scsiq_buf; 8620 scsiq = (ASC_QDONE_INFO *)&scsiq_buf;
8640 done_q_tail = (uchar)AscGetVarDoneQTail(iop_base); 8621 done_q_tail = (uchar)AscGetVarDoneQTail(iop_base);
@@ -8746,7 +8727,7 @@ static int AscIsrQDone(ASC_DVC_VAR *asc_dvc)
8746 } 8727 }
8747 } 8728 }
8748 if ((scsiq->cntl & QC_NO_CALLBACK) == 0) { 8729 if ((scsiq->cntl & QC_NO_CALLBACK) == 0) {
8749 (*asc_isr_callback) (asc_dvc, scsiq); 8730 asc_isr_callback(asc_dvc, scsiq);
8750 } else { 8731 } else {
8751 if ((AscReadLramByte(iop_base, 8732 if ((AscReadLramByte(iop_base,
8752 (ushort)(q_addr + (ushort) 8733 (ushort)(q_addr + (ushort)
@@ -8764,7 +8745,7 @@ static int AscIsrQDone(ASC_DVC_VAR *asc_dvc)
8764 AscSetLibErrorCode(asc_dvc, ASCQ_ERR_Q_STATUS); 8745 AscSetLibErrorCode(asc_dvc, ASCQ_ERR_Q_STATUS);
8765 FATAL_ERR_QDONE: 8746 FATAL_ERR_QDONE:
8766 if ((scsiq->cntl & QC_NO_CALLBACK) == 0) { 8747 if ((scsiq->cntl & QC_NO_CALLBACK) == 0) {
8767 (*asc_isr_callback) (asc_dvc, scsiq); 8748 asc_isr_callback(asc_dvc, scsiq);
8768 } 8749 }
8769 return (0x80); 8750 return (0x80);
8770 } 8751 }
@@ -8790,9 +8771,7 @@ static int AscISR(ASC_DVC_VAR *asc_dvc)
8790 return int_pending; 8771 return int_pending;
8791 } 8772 }
8792 8773
8793 if (((asc_dvc->init_state & ASC_INIT_STATE_END_LOAD_MC) == 0) 8774 if ((asc_dvc->init_state & ASC_INIT_STATE_END_LOAD_MC) == 0) {
8794 || (asc_dvc->isr_callback == 0)
8795 ) {
8796 return (ERR); 8775 return (ERR);
8797 } 8776 }
8798 if (asc_dvc->in_critical_cnt != 0) { 8777 if (asc_dvc->in_critical_cnt != 0) {
@@ -9191,7 +9170,6 @@ static int AscExeScsiQueue(ASC_DVC_VAR *asc_dvc, ASC_SCSI_Q *scsiq)
9191 int disable_syn_offset_one_fix; 9170 int disable_syn_offset_one_fix;
9192 int i; 9171 int i;
9193 ASC_PADDR addr; 9172 ASC_PADDR addr;
9194 ASC_EXE_CALLBACK asc_exe_callback;
9195 ushort sg_entry_cnt = 0; 9173 ushort sg_entry_cnt = 0;
9196 ushort sg_entry_cnt_minus_one = 0; 9174 ushort sg_entry_cnt_minus_one = 0;
9197 uchar target_ix; 9175 uchar target_ix;
@@ -9205,7 +9183,6 @@ static int AscExeScsiQueue(ASC_DVC_VAR *asc_dvc, ASC_SCSI_Q *scsiq)
9205 9183
9206 iop_base = asc_dvc->iop_base; 9184 iop_base = asc_dvc->iop_base;
9207 sg_head = scsiq->sg_head; 9185 sg_head = scsiq->sg_head;
9208 asc_exe_callback = asc_dvc->exe_callback;
9209 if (asc_dvc->err_code != 0) 9186 if (asc_dvc->err_code != 0)
9210 return (ERR); 9187 return (ERR);
9211 if (scsiq == (ASC_SCSI_Q *)0L) { 9188 if (scsiq == (ASC_SCSI_Q *)0L) {
@@ -9366,9 +9343,6 @@ static int AscExeScsiQueue(ASC_DVC_VAR *asc_dvc, ASC_SCSI_Q *scsiq)
9366 AscSendScsiQueue(asc_dvc, scsiq, 9343 AscSendScsiQueue(asc_dvc, scsiq,
9367 n_q_required)) == 1) { 9344 n_q_required)) == 1) {
9368 asc_dvc->in_critical_cnt--; 9345 asc_dvc->in_critical_cnt--;
9369 if (asc_exe_callback != 0) {
9370 (*asc_exe_callback) (asc_dvc, scsiq);
9371 }
9372 DvcLeaveCritical(last_int_level); 9346 DvcLeaveCritical(last_int_level);
9373 return (sta); 9347 return (sta);
9374 } 9348 }
@@ -9414,9 +9388,6 @@ static int AscExeScsiQueue(ASC_DVC_VAR *asc_dvc, ASC_SCSI_Q *scsiq)
9414 if ((sta = AscSendScsiQueue(asc_dvc, scsiq, 9388 if ((sta = AscSendScsiQueue(asc_dvc, scsiq,
9415 n_q_required)) == 1) { 9389 n_q_required)) == 1) {
9416 asc_dvc->in_critical_cnt--; 9390 asc_dvc->in_critical_cnt--;
9417 if (asc_exe_callback != 0) {
9418 (*asc_exe_callback) (asc_dvc, scsiq);
9419 }
9420 DvcLeaveCritical(last_int_level); 9391 DvcLeaveCritical(last_int_level);
9421 return (sta); 9392 return (sta);
9422 } 9393 }
@@ -16745,7 +16716,7 @@ static int AdvISR(ADV_DVC_VAR *asc_dvc)
16745 16716
16746 /* 16717 /*
16747 * Notify the driver of an asynchronous microcode condition by 16718 * Notify the driver of an asynchronous microcode condition by
16748 * calling the ADV_DVC_VAR.async_callback function. The function 16719 * calling the adv_async_callback function. The function
16749 * is passed the microcode ASC_MC_INTRB_CODE byte value. 16720 * is passed the microcode ASC_MC_INTRB_CODE byte value.
16750 */ 16721 */
16751 if (int_stat & ADV_INTR_STATUS_INTRB) { 16722 if (int_stat & ADV_INTR_STATUS_INTRB) {
@@ -16767,9 +16738,7 @@ static int AdvISR(ADV_DVC_VAR *asc_dvc)
16767 } 16738 }
16768 } 16739 }
16769 16740
16770 if (asc_dvc->async_callback != 0) { 16741 adv_async_callback(asc_dvc, intrb_code);
16771 (*asc_dvc->async_callback) (asc_dvc, intrb_code);
16772 }
16773 } 16742 }
16774 16743
16775 /* 16744 /*
@@ -16827,7 +16796,7 @@ static int AdvISR(ADV_DVC_VAR *asc_dvc)
16827 * the ADV_SCSI_REQ_Q pointer to its callback function. 16796 * the ADV_SCSI_REQ_Q pointer to its callback function.
16828 */ 16797 */
16829 scsiq->a_flag |= ADV_SCSIQ_DONE; 16798 scsiq->a_flag |= ADV_SCSIQ_DONE;
16830 (*asc_dvc->isr_callback) (asc_dvc, scsiq); 16799 adv_isr_callback(asc_dvc, scsiq);
16831 /* 16800 /*
16832 * Note: After the driver callback function is called, 'scsiq' 16801 * Note: After the driver callback function is called, 'scsiq'
16833 * can no longer be referenced. 16802 * can no longer be referenced.
@@ -17097,15 +17066,12 @@ advansys_board_found(int iop, struct device *dev, int bus_type)
17097 asc_dvc_varp->cfg = &boardp->dvc_cfg.asc_dvc_cfg; 17066 asc_dvc_varp->cfg = &boardp->dvc_cfg.asc_dvc_cfg;
17098 asc_dvc_varp->cfg->overrun_buf = &overrun_buf[0]; 17067 asc_dvc_varp->cfg->overrun_buf = &overrun_buf[0];
17099 asc_dvc_varp->iop_base = iop; 17068 asc_dvc_varp->iop_base = iop;
17100 asc_dvc_varp->isr_callback = asc_isr_callback;
17101 } else { 17069 } else {
17102#ifdef CONFIG_PCI 17070#ifdef CONFIG_PCI
17103 ASC_DBG(1, "advansys_board_found: wide board\n"); 17071 ASC_DBG(1, "advansys_board_found: wide board\n");
17104 adv_dvc_varp = &boardp->dvc_var.adv_dvc_var; 17072 adv_dvc_varp = &boardp->dvc_var.adv_dvc_var;
17105 adv_dvc_varp->drv_ptr = boardp; 17073 adv_dvc_varp->drv_ptr = boardp;
17106 adv_dvc_varp->cfg = &boardp->dvc_cfg.adv_dvc_cfg; 17074 adv_dvc_varp->cfg = &boardp->dvc_cfg.adv_dvc_cfg;
17107 adv_dvc_varp->isr_callback = adv_isr_callback;
17108 adv_dvc_varp->async_callback = adv_async_callback;
17109 if (pdev->device == PCI_DEVICE_ID_ASP_ABP940UW) { 17075 if (pdev->device == PCI_DEVICE_ID_ASP_ABP940UW) {
17110 ASC_DBG(1, "advansys_board_found: ASC-3550\n"); 17076 ASC_DBG(1, "advansys_board_found: ASC-3550\n");
17111 adv_dvc_varp->chip_type = ADV_CHIP_ASC3550; 17077 adv_dvc_varp->chip_type = ADV_CHIP_ASC3550;