Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93951
b: refs/heads/master
c: d1d7b19
h: refs/heads/master
i:
  93949: 9b6ad83
  93947: c11d2ed
  93943: 8132071
  93935: b0cc007
  93919: d996bd7
  93887: 7b5dde5
  93823: b18bb34
  93695: 9ee7fd4
v: v3
  • Loading branch information
Denys Vlasenko authored and James Bottomley committed Apr 27, 2008
1 parent d251556 commit 3d9b405
Show file tree
Hide file tree
Showing 13 changed files with 196 additions and 258 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d10c2e4627b0dda286bcd1c77720eb5fe4a04f93
refs/heads/master: d1d7b19d433188e94fc87cc7ca66363cd77a0bba
17 changes: 3 additions & 14 deletions trunk/drivers/scsi/aic7xxx/aic79xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -1314,15 +1314,15 @@ typedef int (ahd_device_setup_t)(struct ahd_softc *);
struct ahd_pci_identity {
uint64_t full_id;
uint64_t id_mask;
char *name;
const char *name;
ahd_device_setup_t *setup;
};

/***************************** VL/EISA Declarations ***************************/
struct aic7770_identity {
uint32_t full_id;
uint32_t id_mask;
char *name;
const char *name;
ahd_device_setup_t *setup;
};
extern struct aic7770_identity aic7770_ident_table [];
Expand All @@ -1333,7 +1333,6 @@ extern const int ahd_num_aic7770_devs;

/*************************** Function Declarations ****************************/
/******************************************************************************/
void ahd_reset_cmds_pending(struct ahd_softc *ahd);

/***************************** PCI Front End *********************************/
struct ahd_pci_identity *ahd_find_pci_device(ahd_dev_softc_t);
Expand Down Expand Up @@ -1376,16 +1375,6 @@ int ahd_write_flexport(struct ahd_softc *ahd,
int ahd_read_flexport(struct ahd_softc *ahd, u_int addr,
uint8_t *value);

/*************************** Interrupt Services *******************************/
void ahd_run_qoutfifo(struct ahd_softc *ahd);
#ifdef AHD_TARGET_MODE
void ahd_run_tqinfifo(struct ahd_softc *ahd, int paused);
#endif
void ahd_handle_hwerrint(struct ahd_softc *ahd);
void ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat);
void ahd_handle_scsiint(struct ahd_softc *ahd,
u_int intstat);

/***************************** Error Recovery *********************************/
typedef enum {
SEARCH_COMPLETE,
Expand Down Expand Up @@ -1479,7 +1468,7 @@ extern uint32_t ahd_debug;
void ahd_print_devinfo(struct ahd_softc *ahd,
struct ahd_devinfo *devinfo);
void ahd_dump_card_state(struct ahd_softc *ahd);
int ahd_print_register(ahd_reg_parse_entry_t *table,
int ahd_print_register(const ahd_reg_parse_entry_t *table,
u_int num_entries,
const char *name,
u_int address,
Expand Down
88 changes: 55 additions & 33 deletions trunk/drivers/scsi/aic7xxx/aic79xx_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,18 @@ static int ahd_match_scb(struct ahd_softc *ahd, struct scb *scb,
int target, char channel, int lun,
u_int tag, role_t role);

static void ahd_reset_cmds_pending(struct ahd_softc *ahd);

/*************************** Interrupt Services *******************************/
static void ahd_run_qoutfifo(struct ahd_softc *ahd);
#ifdef AHD_TARGET_MODE
static void ahd_run_tqinfifo(struct ahd_softc *ahd, int paused);
#endif
static void ahd_handle_hwerrint(struct ahd_softc *ahd);
static void ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat);
static void ahd_handle_scsiint(struct ahd_softc *ahd,
u_int intstat);

/************************ Sequencer Execution Control *************************/
void
ahd_set_modes(struct ahd_softc *ahd, ahd_mode src, ahd_mode dst)
Expand All @@ -285,7 +297,7 @@ ahd_set_modes(struct ahd_softc *ahd, ahd_mode src, ahd_mode dst)
ahd->dst_mode = dst;
}

void
static void
ahd_update_modes(struct ahd_softc *ahd)
{
ahd_mode_state mode_ptr;
Expand All @@ -301,7 +313,7 @@ ahd_update_modes(struct ahd_softc *ahd)
ahd_known_modes(ahd, src, dst);
}

void
static void
ahd_assert_modes(struct ahd_softc *ahd, ahd_mode srcmode,
ahd_mode dstmode, const char *file, int line)
{
Expand Down Expand Up @@ -422,7 +434,7 @@ ahd_sg_setup(struct ahd_softc *ahd, struct scb *scb,
}
}

void
static void
ahd_setup_scb_common(struct ahd_softc *ahd, struct scb *scb)
{
/* XXX Handle target mode SCBs. */
Expand All @@ -443,7 +455,7 @@ ahd_setup_scb_common(struct ahd_softc *ahd, struct scb *scb)
ahd_htole32(scb->sense_busaddr);
}

void
static void
ahd_setup_data_scb(struct ahd_softc *ahd, struct scb *scb)
{
/*
Expand Down Expand Up @@ -480,7 +492,7 @@ ahd_setup_data_scb(struct ahd_softc *ahd, struct scb *scb)
scb->hscb->sgptr = ahd_htole32(scb->sg_list_busaddr|SG_FULL_RESID);
}

void
static void
ahd_setup_noxfer_scb(struct ahd_softc *ahd, struct scb *scb)
{
scb->hscb->sgptr = ahd_htole32(SG_LIST_NULL);
Expand All @@ -489,7 +501,7 @@ ahd_setup_noxfer_scb(struct ahd_softc *ahd, struct scb *scb)
}

/************************** Memory mapping routines ***************************/
void *
static void *
ahd_sg_bus_to_virt(struct ahd_softc *ahd, struct scb *scb, uint32_t sg_busaddr)
{
dma_addr_t sg_offset;
Expand All @@ -499,7 +511,7 @@ ahd_sg_bus_to_virt(struct ahd_softc *ahd, struct scb *scb, uint32_t sg_busaddr)
return ((uint8_t *)scb->sg_list + sg_offset);
}

uint32_t
static uint32_t
ahd_sg_virt_to_bus(struct ahd_softc *ahd, struct scb *scb, void *sg)
{
dma_addr_t sg_offset;
Expand All @@ -511,7 +523,7 @@ ahd_sg_virt_to_bus(struct ahd_softc *ahd, struct scb *scb, void *sg)
return (scb->sg_list_busaddr + sg_offset);
}

void
static void
ahd_sync_scb(struct ahd_softc *ahd, struct scb *scb, int op)
{
ahd_dmamap_sync(ahd, ahd->scb_data.hscb_dmat,
Expand All @@ -532,7 +544,7 @@ ahd_sync_sglist(struct ahd_softc *ahd, struct scb *scb, int op)
/*len*/ahd_sg_size(ahd) * scb->sg_count, op);
}

void
static void
ahd_sync_sense(struct ahd_softc *ahd, struct scb *scb, int op)
{
ahd_dmamap_sync(ahd, ahd->scb_data.sense_dmat,
Expand All @@ -541,12 +553,14 @@ ahd_sync_sense(struct ahd_softc *ahd, struct scb *scb, int op)
/*len*/AHD_SENSE_BUFSIZE, op);
}

uint32_t
#ifdef AHD_TARGET_MODE
static uint32_t
ahd_targetcmd_offset(struct ahd_softc *ahd, u_int index)
{
return (((uint8_t *)&ahd->targetcmds[index])
- (uint8_t *)ahd->qoutfifo);
}
#endif

/*********************** Miscelaneous Support Functions ***********************/
/*
Expand Down Expand Up @@ -653,31 +667,35 @@ ahd_set_scbptr(struct ahd_softc *ahd, u_int scbptr)
ahd_outb(ahd, SCBPTR+1, (scbptr >> 8) & 0xFF);
}

u_int
#if 0 /* unused */
static u_int
ahd_get_hnscb_qoff(struct ahd_softc *ahd)
{
return (ahd_inw_atomic(ahd, HNSCB_QOFF));
}
#endif

void
static void
ahd_set_hnscb_qoff(struct ahd_softc *ahd, u_int value)
{
ahd_outw_atomic(ahd, HNSCB_QOFF, value);
}

u_int
#if 0 /* unused */
static u_int
ahd_get_hescb_qoff(struct ahd_softc *ahd)
{
return (ahd_inb(ahd, HESCB_QOFF));
}
#endif

void
static void
ahd_set_hescb_qoff(struct ahd_softc *ahd, u_int value)
{
ahd_outb(ahd, HESCB_QOFF, value);
}

u_int
static u_int
ahd_get_snscb_qoff(struct ahd_softc *ahd)
{
u_int oldvalue;
Expand All @@ -688,35 +706,39 @@ ahd_get_snscb_qoff(struct ahd_softc *ahd)
return (oldvalue);
}

void
static void
ahd_set_snscb_qoff(struct ahd_softc *ahd, u_int value)
{
AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK);
ahd_outw(ahd, SNSCB_QOFF, value);
}

u_int
#if 0 /* unused */
static u_int
ahd_get_sescb_qoff(struct ahd_softc *ahd)
{
AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK);
return (ahd_inb(ahd, SESCB_QOFF));
}
#endif

void
static void
ahd_set_sescb_qoff(struct ahd_softc *ahd, u_int value)
{
AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK);
ahd_outb(ahd, SESCB_QOFF, value);
}

u_int
#if 0 /* unused */
static u_int
ahd_get_sdscb_qoff(struct ahd_softc *ahd)
{
AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK);
return (ahd_inb(ahd, SDSCB_QOFF) | (ahd_inb(ahd, SDSCB_QOFF + 1) << 8));
}
#endif

void
static void
ahd_set_sdscb_qoff(struct ahd_softc *ahd, u_int value)
{
AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK);
Expand Down Expand Up @@ -756,14 +778,14 @@ ahd_inw_scbram(struct ahd_softc *ahd, u_int offset)
| (ahd_inb_scbram(ahd, offset+1) << 8));
}

uint32_t
static uint32_t
ahd_inl_scbram(struct ahd_softc *ahd, u_int offset)
{
return (ahd_inw_scbram(ahd, offset)
| (ahd_inw_scbram(ahd, offset+2) << 16));
}

uint64_t
static uint64_t
ahd_inq_scbram(struct ahd_softc *ahd, u_int offset)
{
return (ahd_inl_scbram(ahd, offset)
Expand All @@ -784,7 +806,7 @@ ahd_lookup_scb(struct ahd_softc *ahd, u_int tag)
return (scb);
}

void
static void
ahd_swap_with_next_hscb(struct ahd_softc *ahd, struct scb *scb)
{
struct hardware_scb *q_hscb;
Expand Down Expand Up @@ -869,15 +891,15 @@ ahd_queue_scb(struct ahd_softc *ahd, struct scb *scb)
}

/************************** Interrupt Processing ******************************/
void
static void
ahd_sync_qoutfifo(struct ahd_softc *ahd, int op)
{
ahd_dmamap_sync(ahd, ahd->shared_data_dmat, ahd->shared_data_map.dmamap,
/*offset*/0,
/*len*/AHD_SCB_MAX * sizeof(struct ahd_completion), op);
}

void
static void
ahd_sync_tqinfifo(struct ahd_softc *ahd, int op)
{
#ifdef AHD_TARGET_MODE
Expand All @@ -897,7 +919,7 @@ ahd_sync_tqinfifo(struct ahd_softc *ahd, int op)
*/
#define AHD_RUN_QOUTFIFO 0x1
#define AHD_RUN_TQINFIFO 0x2
u_int
static u_int
ahd_check_cmdcmpltqueues(struct ahd_softc *ahd)
{
u_int retval;
Expand Down Expand Up @@ -1640,7 +1662,7 @@ ahd_run_data_fifo(struct ahd_softc *ahd, struct scb *scb)
* a copy of the first byte (little endian) of the sgptr
* hscb field.
*/
void
static void
ahd_run_qoutfifo(struct ahd_softc *ahd)
{
struct ahd_completion *completion;
Expand Down Expand Up @@ -1679,7 +1701,7 @@ ahd_run_qoutfifo(struct ahd_softc *ahd)
}

/************************* Interrupt Handling *********************************/
void
static void
ahd_handle_hwerrint(struct ahd_softc *ahd)
{
/*
Expand Down Expand Up @@ -1753,7 +1775,7 @@ ahd_dump_sglist(struct scb *scb)
}
#endif /* AHD_DEBUG */

void
static void
ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat)
{
u_int seqintcode;
Expand Down Expand Up @@ -2365,7 +2387,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat)
ahd_unpause(ahd);
}

void
static void
ahd_handle_scsiint(struct ahd_softc *ahd, u_int intstat)
{
struct scb *scb;
Expand Down Expand Up @@ -8131,7 +8153,7 @@ ahd_qinfifo_count(struct ahd_softc *ahd)
+ ARRAY_SIZE(ahd->qinfifo) - wrap_qinpos);
}

void
static void
ahd_reset_cmds_pending(struct ahd_softc *ahd)
{
struct scb *scb;
Expand Down Expand Up @@ -9656,7 +9678,7 @@ ahd_probe_stack_size(struct ahd_softc *ahd)
}

int
ahd_print_register(ahd_reg_parse_entry_t *table, u_int num_entries,
ahd_print_register(const ahd_reg_parse_entry_t *table, u_int num_entries,
const char *name, u_int address, u_int value,
u_int *cur_column, u_int wrap_point)
{
Expand Down Expand Up @@ -10647,7 +10669,7 @@ ahd_update_scsiid(struct ahd_softc *ahd, u_int targid_mask)
#endif
}

void
static void
ahd_run_tqinfifo(struct ahd_softc *ahd, int paused)
{
struct target_cmd *cmd;
Expand Down
Loading

0 comments on commit 3d9b405

Please sign in to comment.