Lines Matching refs:ha

10     gdth_ha_str *ha = shost_priv(host);  in gdth_set_info()  local
13 TRACE2(("gdth_set_info() ha %d\n",ha->hanum,)); in gdth_set_info()
19 ret_val = gdth_set_asc_info(host, buffer, length, ha); in gdth_set_info()
27 int length, gdth_ha_str *ha) in gdth_set_asc_info() argument
39 TRACE2(("gdth_set_asc_info() ha %d\n",ha->hanum)); in gdth_set_asc_info()
60 if (ha->hdr[i].present) { in gdth_set_asc_info()
66 if (ha->cache_feat & GDT_64BIT) { in gdth_set_asc_info()
98 if (ha->cache_feat & GDT_WR_THROUGH) { in gdth_set_asc_info()
115 if (!gdth_ioctl_alloc(ha, sizeof(gdth_cpar_str), TRUE, &paddr)) in gdth_set_asc_info()
117 pcpar = (gdth_cpar_str *)ha->pscratch; in gdth_set_asc_info()
118 memcpy( pcpar, &ha->cpar, sizeof(gdth_cpar_str) ); in gdth_set_asc_info()
129 gdth_ioctl_free(ha, GDTH_SCRATCH, ha->pscratch, paddr); in gdth_set_asc_info()
140 gdth_ha_str *ha = shost_priv(host); in gdth_show_info() local
170 TRACE2(("gdth_get_info() ha %d\n",ha->hanum)); in gdth_show_info()
198 ha->hanum, ha->binfo.type_string); in gdth_show_info()
203 if (ha->more_proc) in gdth_show_info()
205 (u8)(ha->binfo.upd_fw_ver>>24), in gdth_show_info()
206 (u8)(ha->binfo.upd_fw_ver>>16), in gdth_show_info()
207 (u8)(ha->binfo.upd_fw_ver), in gdth_show_info()
208 ha->bfeat.raid ? 'R':'N', in gdth_show_info()
209 ha->binfo.upd_revision); in gdth_show_info()
211 seq_printf(m, "%d.%02d\n", (u8)(ha->cpar.version>>8), in gdth_show_info()
212 (u8)(ha->cpar.version)); in gdth_show_info()
214 if (ha->more_proc) in gdth_show_info()
218 ha->binfo.ser_no, ha->binfo.memsize / 1024); in gdth_show_info()
225 ha->dma32_cnt, ha->dma64_cnt); in gdth_show_info()
228 if (ha->more_proc) { in gdth_show_info()
233 buf = gdth_ioctl_alloc(ha, GDTH_SCRATCH, FALSE, &paddr); in gdth_show_info()
236 for (i = 0; i < ha->bus_cnt; ++i) { in gdth_show_info()
245 gdtcmd->u.ioctl.channel = ha->raw[i].address | INVALID_CHANNEL; in gdth_show_info()
246 pds->bid = ha->raw[i].local_no; in gdth_show_info()
248 pds->entries = ha->raw[i].pdev_cnt; in gdth_show_info()
258 for (j = 0; j < ha->raw[i].pdev_cnt; ++j) { in gdth_show_info()
261 i, ha->raw[i].id_list[j])); in gdth_show_info()
269 ha->raw[i].address | ha->raw[i].id_list[j]; in gdth_show_info()
307 i, ha->raw[i].id_list[j])); in gdth_show_info()
315 ha->raw[i].address | ha->raw[i].id_list[j]; in gdth_show_info()
326 gdth_ioctl_free(ha, GDTH_SCRATCH, buf, paddr); in gdth_show_info()
335 buf = gdth_ioctl_alloc(ha, GDTH_SCRATCH, FALSE, &paddr); in gdth_show_info()
339 if (!ha->hdr[i].is_logdrv) in gdth_show_info()
404 if (!ha->hdr[i].is_arraydrv) in gdth_show_info()
407 sprintf(hrec, "%d", ha->hdr[i].master_no); in gdth_show_info()
411 gdth_ioctl_free(ha, GDTH_SCRATCH, buf, paddr); in gdth_show_info()
420 buf = gdth_ioctl_alloc(ha, GDTH_SCRATCH, FALSE, &paddr); in gdth_show_info()
424 if (!(ha->hdr[i].is_arraydrv && ha->hdr[i].is_master)) in gdth_show_info()
471 gdth_ioctl_free(ha, GDTH_SCRATCH, buf, paddr); in gdth_show_info()
480 buf = gdth_ioctl_alloc(ha, sizeof(gdth_hget_str), FALSE, &paddr); in gdth_show_info()
484 if (!ha->hdr[i].is_logdrv || in gdth_show_info()
485 (ha->hdr[i].is_arraydrv && !ha->hdr[i].is_master)) in gdth_show_info()
499 ha->hdr[i].ldr_no = i; in gdth_show_info()
500 ha->hdr[i].rw_attribs = 0; in gdth_show_info()
501 ha->hdr[i].start_sec = 0; in gdth_show_info()
507 ha->hdr[k].ldr_no = phg->entry[j].log_drive; in gdth_show_info()
508 ha->hdr[k].rw_attribs = phg->entry[j].rw_attribs; in gdth_show_info()
509 ha->hdr[k].start_sec = phg->entry[j].start_sec; in gdth_show_info()
513 gdth_ioctl_free(ha, sizeof(gdth_hget_str), buf, paddr); in gdth_show_info()
516 if (!(ha->hdr[i].present)) in gdth_show_info()
521 i, ha->hdr[i].ldr_no); in gdth_show_info()
526 (u32)(ha->hdr[i].size/2048), ha->hdr[i].start_sec); in gdth_show_info()
537 id = gdth_read_event(ha, id, estr); in gdth_show_info()
540 if (estr->event_data.eu.driver.ionode == ha->hanum && in gdth_show_info()
560 static char *gdth_ioctl_alloc(gdth_ha_str *ha, int size, int scratch, in gdth_ioctl_alloc() argument
569 spin_lock_irqsave(&ha->smp_lock, flags); in gdth_ioctl_alloc()
571 if (!ha->scratch_busy && size <= GDTH_SCRATCH) { in gdth_ioctl_alloc()
572 ha->scratch_busy = TRUE; in gdth_ioctl_alloc()
573 ret_val = ha->pscratch; in gdth_ioctl_alloc()
574 *paddr = ha->scratch_phys; in gdth_ioctl_alloc()
580 ret_val = pci_alloc_consistent(ha->pdev, size, &dma_addr); in gdth_ioctl_alloc()
584 spin_unlock_irqrestore(&ha->smp_lock, flags); in gdth_ioctl_alloc()
588 static void gdth_ioctl_free(gdth_ha_str *ha, int size, char *buf, u64 paddr) in gdth_ioctl_free() argument
592 if (buf == ha->pscratch) { in gdth_ioctl_free()
593 spin_lock_irqsave(&ha->smp_lock, flags); in gdth_ioctl_free()
594 ha->scratch_busy = FALSE; in gdth_ioctl_free()
595 spin_unlock_irqrestore(&ha->smp_lock, flags); in gdth_ioctl_free()
597 pci_free_consistent(ha->pdev, size, buf, paddr); in gdth_ioctl_free()
602 static int gdth_ioctl_check_bin(gdth_ha_str *ha, u16 size) in gdth_ioctl_check_bin() argument
607 spin_lock_irqsave(&ha->smp_lock, flags); in gdth_ioctl_check_bin()
610 if (ha->scratch_busy) { in gdth_ioctl_check_bin()
611 if (((gdth_iord_str *)ha->pscratch)->size == (u32)size) in gdth_ioctl_check_bin()
614 spin_unlock_irqrestore(&ha->smp_lock, flags); in gdth_ioctl_check_bin()
619 static void gdth_wait_completion(gdth_ha_str *ha, int busnum, int id) in gdth_wait_completion() argument
627 spin_lock_irqsave(&ha->smp_lock, flags); in gdth_wait_completion()
630 scp = ha->cmd_tab[i].cmnd; in gdth_wait_completion()
638 spin_unlock_irqrestore(&ha->smp_lock, flags); in gdth_wait_completion()
641 spin_lock_irqsave(&ha->smp_lock, flags); in gdth_wait_completion()
644 spin_unlock_irqrestore(&ha->smp_lock, flags); in gdth_wait_completion()