• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/src/linux/linux-2.6/drivers/scsi/

Lines Matching defs:ha

1087 	struct hostdata *ha;
1287 ha = (struct hostdata *)shost->hostdata;
1289 memset(ha, 0, sizeof(struct hostdata));
1290 ha->subversion = subversion;
1291 ha->protocol_rev = protocol_rev;
1292 ha->is_pci = is_pci;
1293 ha->pdev = pdev;
1294 ha->board_number = j;
1296 if (ha->subversion == ESA)
1311 strcpy(ha->board_name, name);
1316 ha->board_name, shost->sg_tablesize);
1323 ha->board_name, shost->can_queue);
1351 ha->cp[i].cp_dma_addr = pci_map_single(ha->pdev,
1352 &ha->cp[i],
1359 ha->cp[i].sglist = kmalloc(sz, gfp_mask);
1360 if (!ha->cp[i].sglist) {
1363 ha->board_name, i);
1368 if (!(ha->sp_cpu_addr = pci_alloc_consistent(ha->pdev,
1370 &ha->sp_dma_addr))) {
1371 printk("%s: pci_alloc_consistent failed, detaching.\n", ha->board_name);
1396 ha->board_name, ha->protocol_rev, bus_type,
1403 ha->board_name, shost->max_id, shost->max_lun);
1407 ha->board_name, i, info.host_addr[3 - i]);
1427 if (ha->pdev) {
1428 pci_set_master(ha->pdev);
1429 if (pci_set_dma_mask(ha->pdev, DMA_32BIT_MASK))
1431 ha->board_name);
1610 static void map_dma(unsigned int i, struct hostdata *ha)
1617 cpp = &ha->cp[i];
1623 H2DEV(pci_map_single(ha->pdev, SCpnt->sense_buffer,
1635 cpp->data_address = H2DEV(pci_map_single(ha->pdev,
1647 count = pci_map_sg(ha->pdev, sgpnt, SCpnt->use_sg, pci_dir);
1655 cpp->data_address = H2DEV(pci_map_single(ha->pdev, cpp->sglist,
1662 static void unmap_dma(unsigned int i, struct hostdata *ha)
1668 cpp = &ha->cp[i];
1673 pci_unmap_single(ha->pdev, DEV2H(cpp->sense_addr),
1677 pci_unmap_sg(ha->pdev, SCpnt->request_buffer, SCpnt->use_sg,
1684 pci_unmap_single(ha->pdev, DEV2H(cpp->data_address),
1688 static void sync_dma(unsigned int i, struct hostdata *ha)
1694 cpp = &ha->cp[i];
1699 pci_dma_sync_single_for_cpu(ha->pdev, DEV2H(cpp->sense_addr),
1704 pci_dma_sync_sg_for_cpu(ha->pdev, SCpnt->request_buffer,
1711 pci_dma_sync_single_for_cpu(ha->pdev,
1716 static void scsi_to_dev_dir(unsigned int i, struct hostdata *ha)
1735 cpp = &ha->cp[i];
1754 ha->board_name);
1775 struct hostdata *ha = (struct hostdata *)shost->hostdata;
1781 ha->board_name, SCpnt->pid, SCpnt);
1785 i = ha->last_cp_used + 1;
1790 if (ha->cp_stat[i] == FREE) {
1791 ha->last_cp_used = i;
1797 printk("%s: qcomm, no free mailbox.\n", ha->board_name);
1802 cpp = &ha->cp[i];
1807 cpp->sp_dma_addr = H2DEV(ha->sp_dma_addr);
1827 scsi_to_dev_dir(i, ha);
1830 map_dma(i, ha);
1834 ha->cp_stat[i] = READY;
1835 flush_dev(SCpnt->device, SCpnt->request->sector, ha, 0);
1841 unmap_dma(i, ha);
1848 ha->cp_stat[i] = IN_USE;
1855 struct hostdata *ha = (struct hostdata *)shost->hostdata;
1869 panic("%s: abort, invalid SCarg->host_scribble.\n", ha->board_name);
1872 printk("%s: abort, timeout error.\n", ha->board_name);
1876 if (ha->cp_stat[i] == FREE) {
1877 printk("%s: abort, mbox %d is free.\n", ha->board_name, i);
1881 if (ha->cp_stat[i] == IN_USE) {
1882 printk("%s: abort, mbox %d is in use.\n", ha->board_name, i);
1884 if (SCarg != ha->cp[i].SCpnt)
1886 ha->board_name, i, SCarg, ha->cp[i].SCpnt);
1890 ha->board_name, i);
1895 if (ha->cp_stat[i] == IN_RESET) {
1896 printk("%s: abort, mbox %d is in reset.\n", ha->board_name, i);
1900 if (ha->cp_stat[i] == LOCKED) {
1901 printk("%s: abort, mbox %d is locked.\n", ha->board_name, i);
1905 if (ha->cp_stat[i] == READY || ha->cp_stat[i] == ABORTING) {
1906 unmap_dma(i, ha);
1909 ha->cp_stat[i] = FREE;
1911 ha->board_name, i, SCarg->pid);
1916 panic("%s: abort, mbox %d, invalid cp_stat.\n", ha->board_name, i);
1925 struct hostdata *ha = (struct hostdata *)shost->hostdata;
1933 printk("%s: reset, pid %ld inactive.\n", ha->board_name, SCarg->pid);
1935 if (ha->in_reset) {
1936 printk("%s: reset, exit, already in reset.\n", ha->board_name);
1942 printk("%s: reset, exit, timeout error.\n", ha->board_name);
1947 ha->retries = 0;
1951 ha->target_redo[k][c] = 1;
1952 ha->target_to[k][c] = 0;
1957 if (ha->cp_stat[i] == FREE)
1960 if (ha->cp_stat[i] == LOCKED) {
1961 ha->cp_stat[i] = FREE;
1963 ha->board_name, i);
1967 if (!(SCpnt = ha->cp[i].SCpnt))
1968 panic("%s: reset, mbox %d, SCpnt == NULL.\n", ha->board_name, i);
1970 if (ha->cp_stat[i] == READY || ha->cp_stat[i] == ABORTING) {
1971 ha->cp_stat[i] = ABORTING;
1973 ha->board_name, i, SCpnt->pid);
1977 ha->cp_stat[i] = IN_RESET;
1979 ha->board_name, i, SCpnt->pid);
1983 panic("%s: reset, mbox %d, garbled SCpnt.\n", ha->board_name, i);
1986 panic("%s: reset, mbox %d, index mismatch.\n", ha->board_name, i);
1990 ha->board_name, i);
1997 printk("%s: reset, cannot reset, timeout error.\n", ha->board_name);
2002 printk("%s: reset, board reset done, enabling interrupts.\n", ha->board_name);
2008 ha->in_reset = 1;
2018 printk("%s: reset, interrupts disabled, loops %d.\n", ha->board_name, limit);
2022 if (ha->cp_stat[i] == IN_RESET) {
2023 SCpnt = ha->cp[i].SCpnt;
2024 unmap_dma(i, ha);
2029 ha->cp_stat[i] = LOCKED;
2033 ha->board_name, i, SCpnt->pid);
2036 else if (ha->cp_stat[i] == ABORTING) {
2037 SCpnt = ha->cp[i].SCpnt;
2038 unmap_dma(i, ha);
2043 ha->cp_stat[i] = FREE;
2047 ha->board_name, i, SCpnt->pid);
2057 ha->in_reset = 0;
2061 printk("%s: reset, exit, pid %ld done.\n", ha->board_name, SCarg->pid);
2063 printk("%s: reset, exit.\n", ha->board_name);
2118 static int reorder(struct hostdata *ha, unsigned long cursec,
2147 cpp = &ha->cp[k];
2197 cpp = &ha->cp[k];
2242 cpp = &ha->cp[k];
2259 struct hostdata *ha, unsigned int ihdlr)
2267 if (ha->cp_stat[k] != READY && ha->cp_stat[k] != IN_USE)
2270 cpp = &ha->cp[k];
2276 if (ha->cp_stat[k] == IN_USE)
2282 if (reorder(ha, cursec, ihdlr, il, n_ready))
2287 cpp = &ha->cp[k];
2296 ha->cp_stat[k] = ABORTING;
2300 ha->cp_stat[k] = IN_USE;
2310 struct hostdata *ha = (struct hostdata *)shost->hostdata;
2313 panic("%s: ihdlr, irq %d, shost->irq %d.\n", ha->board_name, irq,
2320 ha->iocount++;
2323 printk("%s: ihdlr, enter, irq %d, count %d.\n", ha->board_name, irq,
2324 ha->iocount);
2331 ha->board_name, irq, reg, ha->iocount);
2335 spp = &ha->sp;
2338 memcpy(spp, ha->sp_cpu_addr, sizeof(struct mssp));
2341 memset(ha->sp_cpu_addr, 0, sizeof(struct mssp));
2351 if (ha->iocount < 200) {
2361 if (spp->eoc == 0 && ha->iocount > 1)
2364 ha->board_name, irq, reg, ha->iocount);
2368 ha->board_name, spp->cpp_index, irq, reg, ha->iocount);
2376 cpp = &(ha->cp[i]);
2379 if ((ha->iocount > 500) && ((ha->iocount % 500) < 3))
2383 if (ha->cp_stat[i] == IGNORE) {
2384 ha->cp_stat[i] = FREE;
2386 } else if (ha->cp_stat[i] == LOCKED) {
2387 ha->cp_stat[i] = FREE;
2388 printk("%s: ihdlr, mbox %d unlocked, count %d.\n", ha->board_name, i,
2389 ha->iocount);
2391 } else if (ha->cp_stat[i] == FREE) {
2392 printk("%s: ihdlr, mbox %d is free, count %d.\n", ha->board_name, i,
2393 ha->iocount);
2395 } else if (ha->cp_stat[i] == IN_RESET)
2396 printk("%s: ihdlr, mbox %d is in reset.\n", ha->board_name, i);
2397 else if (ha->cp_stat[i] != IN_USE)
2399 ha->board_name, i, ha->cp_stat[i]);
2401 ha->cp_stat[i] = FREE;
2405 panic("%s: ihdlr, mbox %d, SCpnt == NULL.\n", ha->board_name, i);
2408 panic("%s: ihdlr, mbox %d, pid %ld, SCpnt %p garbled.\n", ha->board_name,
2413 ha->board_name, i, SCpnt->pid,
2416 sync_dma(i, ha);
2420 flush_dev(SCpnt->device, SCpnt->request->sector, ha, 1);
2425 if ((ha->iocount > 500) && ((ha->iocount % 200) < 2))
2438 && ha->target_redo[SCpnt->device->id][SCpnt->
2453 ha->target_redo[SCpnt->device->id][SCpnt->device->
2457 (!(tstatus == CHECK_CONDITION && ha->iocount <= 1000 &&
2461 ha->board_name,
2466 ha->target_to[SCpnt->device->id][SCpnt->device->channel] = 0;
2468 if (ha->last_retried_pid == SCpnt->pid)
2469 ha->retries = 0;
2475 if (ha->target_to[SCpnt->device->id][SCpnt->device->channel] > 1)
2479 ha->target_to[SCpnt->device->id][SCpnt->device->
2491 ha->target_redo[k][c] = 1;
2494 && ha->retries < MAX_INTERNAL_RETRIES) {
2502 ha->retries++;
2503 ha->last_retried_pid = SCpnt->pid;
2526 if ((spp->adapter_status != ASOK && ha->iocount > 1000) ||
2528 spp->adapter_status != ASST && ha->iocount <= 1000) ||
2534 SCpnt->pid, reg, ha->iocount);
2536 unmap_dma(i, ha);
2544 printk("%s: ihdlr, exit, irq %d, count %d.\n", ha->board_name,
2545 irq, ha->iocount);
2573 struct hostdata *ha = (struct hostdata *)shost->hostdata;
2577 kfree((&ha->cp[i])->sglist);
2580 pci_unmap_single(ha->pdev, ha->cp[i].cp_dma_addr,
2583 if (ha->sp_cpu_addr)
2584 pci_free_consistent(ha->pdev, sizeof(struct mssp),
2585 ha->sp_cpu_addr, ha->sp_dma_addr);
2587 free_irq(shost->irq, &sha[ha->board_number]);