| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: aic79xx.c,v 1.59 2021/10/25 07:45:01 ryo Exp $ */ | | 1 | /* $NetBSD: aic79xx.c,v 1.60 2021/12/05 02:54:53 msaitoh Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Core routines and tables shareable across OS platforms. | | 4 | * Core routines and tables shareable across OS platforms. |
5 | * | | 5 | * |
6 | * Copyright (c) 1994-2002 Justin T. Gibbs. | | 6 | * Copyright (c) 1994-2002 Justin T. Gibbs. |
7 | * Copyright (c) 2000-2003 Adaptec Inc. | | 7 | * Copyright (c) 2000-2003 Adaptec Inc. |
8 | * All rights reserved. | | 8 | * All rights reserved. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions, and the following disclaimer, | | 14 | * notice, this list of conditions, and the following disclaimer, |
| @@ -39,27 +39,27 @@ | | | @@ -39,27 +39,27 @@ |
39 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 39 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
40 | * POSSIBILITY OF SUCH DAMAGES. | | 40 | * POSSIBILITY OF SUCH DAMAGES. |
41 | * | | 41 | * |
42 | * Id: //depot/aic7xxx/aic7xxx/aic79xx.c#202 $ | | 42 | * Id: //depot/aic7xxx/aic7xxx/aic79xx.c#202 $ |
43 | * | | 43 | * |
44 | * $FreeBSD: src/sys/dev/aic7xxx/aic79xx.c,v 1.24 2003/06/28 04:46:54 gibbs Exp $ | | 44 | * $FreeBSD: src/sys/dev/aic7xxx/aic79xx.c,v 1.24 2003/06/28 04:46:54 gibbs Exp $ |
45 | */ | | 45 | */ |
46 | /* | | 46 | /* |
47 | * Ported from FreeBSD by Pascal Renauld, Network Storage Solutions, Inc. | | 47 | * Ported from FreeBSD by Pascal Renauld, Network Storage Solutions, Inc. |
48 | * - April 2003 | | 48 | * - April 2003 |
49 | */ | | 49 | */ |
50 | | | 50 | |
51 | #include <sys/cdefs.h> | | 51 | #include <sys/cdefs.h> |
52 | __KERNEL_RCSID(0, "$NetBSD: aic79xx.c,v 1.59 2021/10/25 07:45:01 ryo Exp $"); | | 52 | __KERNEL_RCSID(0, "$NetBSD: aic79xx.c,v 1.60 2021/12/05 02:54:53 msaitoh Exp $"); |
53 | | | 53 | |
54 | #include <dev/ic/aic79xx_osm.h> | | 54 | #include <dev/ic/aic79xx_osm.h> |
55 | #include <dev/ic/aic79xx_inline.h> | | 55 | #include <dev/ic/aic79xx_inline.h> |
56 | #include <dev/ic/aic7xxx_cam.h> | | 56 | #include <dev/ic/aic7xxx_cam.h> |
57 | | | 57 | |
58 | #include <dev/microcode/aic7xxx/aicasm.h> | | 58 | #include <dev/microcode/aic7xxx/aicasm.h> |
59 | #include <dev/microcode/aic7xxx/aicasm_insformat.h> | | 59 | #include <dev/microcode/aic7xxx/aicasm_insformat.h> |
60 | | | 60 | |
61 | | | 61 | |
62 | /******************************** Globals *************************************/ | | 62 | /******************************** Globals *************************************/ |
63 | struct ahd_softc_tailq ahd_tailq = TAILQ_HEAD_INITIALIZER(ahd_tailq); | | 63 | struct ahd_softc_tailq ahd_tailq = TAILQ_HEAD_INITIALIZER(ahd_tailq); |
64 | | | 64 | |
65 | /***************************** Lookup Tables **********************************/ | | 65 | /***************************** Lookup Tables **********************************/ |
| @@ -4788,27 +4788,27 @@ ahd_handle_ign_wide_residue(struct ahd_s | | | @@ -4788,27 +4788,27 @@ ahd_handle_ign_wide_residue(struct ahd_s |
4788 | */ | | 4788 | */ |
4789 | } else { | | 4789 | } else { |
4790 | uint32_t data_cnt; | | 4790 | uint32_t data_cnt; |
4791 | uint64_t data_addr; | | 4791 | uint64_t data_addr; |
4792 | uint32_t sglen; | | 4792 | uint32_t sglen; |
4793 | | | 4793 | |
4794 | /* Pull in the rest of the sgptr */ | | 4794 | /* Pull in the rest of the sgptr */ |
4795 | sgptr = ahd_inl_scbram(ahd, SCB_RESIDUAL_SGPTR); | | 4795 | sgptr = ahd_inl_scbram(ahd, SCB_RESIDUAL_SGPTR); |
4796 | data_cnt = ahd_inl_scbram(ahd, SCB_RESIDUAL_DATACNT); | | 4796 | data_cnt = ahd_inl_scbram(ahd, SCB_RESIDUAL_DATACNT); |
4797 | if ((sgptr & SG_LIST_NULL) != 0) { | | 4797 | if ((sgptr & SG_LIST_NULL) != 0) { |
4798 | /* | | 4798 | /* |
4799 | * The residual data count is not updated | | 4799 | * The residual data count is not updated |
4800 | * for the command run to completion case. | | 4800 | * for the command run to completion case. |
4801 | * Explcitly zero the count. | | 4801 | * Expilcitly zero the count. |
4802 | */ | | 4802 | */ |
4803 | data_cnt &= ~AHD_SG_LEN_MASK; | | 4803 | data_cnt &= ~AHD_SG_LEN_MASK; |
4804 | } | | 4804 | } |
4805 | data_addr = ahd_inq(ahd, SHADDR); | | 4805 | data_addr = ahd_inq(ahd, SHADDR); |
4806 | data_cnt += 1; | | 4806 | data_cnt += 1; |
4807 | data_addr -= 1; | | 4807 | data_addr -= 1; |
4808 | sgptr &= SG_PTR_MASK; | | 4808 | sgptr &= SG_PTR_MASK; |
4809 | if ((ahd->flags & AHD_64BIT_ADDRESSING) != 0) { | | 4809 | if ((ahd->flags & AHD_64BIT_ADDRESSING) != 0) { |
4810 | struct ahd_dma64_seg *sg; | | 4810 | struct ahd_dma64_seg *sg; |
4811 | | | 4811 | |
4812 | sg = ahd_sg_bus_to_virt(ahd, scb, sgptr); | | 4812 | sg = ahd_sg_bus_to_virt(ahd, scb, sgptr); |
4813 | | | 4813 | |
4814 | /* | | 4814 | /* |