diff options
Diffstat (limited to 'drivers/scsi/sym53c8xx_2/sym_nvram.c')
-rw-r--r-- | drivers/scsi/sym53c8xx_2/sym_nvram.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/drivers/scsi/sym53c8xx_2/sym_nvram.c b/drivers/scsi/sym53c8xx_2/sym_nvram.c index 994b7566bcac..15d69298ab6e 100644 --- a/drivers/scsi/sym53c8xx_2/sym_nvram.c +++ b/drivers/scsi/sym53c8xx_2/sym_nvram.c | |||
@@ -92,29 +92,32 @@ void sym_nvram_setup_host(struct Scsi_Host *shost, struct sym_hcb *np, struct sy | |||
92 | * Get target set-up from Symbios format NVRAM. | 92 | * Get target set-up from Symbios format NVRAM. |
93 | */ | 93 | */ |
94 | static void | 94 | static void |
95 | sym_Symbios_setup_target(struct sym_hcb *np, int target, Symbios_nvram *nvram) | 95 | sym_Symbios_setup_target(struct sym_tcb *tp, int target, Symbios_nvram *nvram) |
96 | { | 96 | { |
97 | struct sym_tcb *tp = &np->target[target]; | ||
98 | Symbios_target *tn = &nvram->target[target]; | 97 | Symbios_target *tn = &nvram->target[target]; |
99 | 98 | ||
100 | tp->usrtags = | 99 | if (!(tn->flags & SYMBIOS_QUEUE_TAGS_ENABLED)) |
101 | (tn->flags & SYMBIOS_QUEUE_TAGS_ENABLED)? SYM_SETUP_MAX_TAG : 0; | 100 | tp->usrtags = 0; |
102 | |||
103 | if (!(tn->flags & SYMBIOS_DISCONNECT_ENABLE)) | 101 | if (!(tn->flags & SYMBIOS_DISCONNECT_ENABLE)) |
104 | tp->usrflags &= ~SYM_DISC_ENABLED; | 102 | tp->usrflags &= ~SYM_DISC_ENABLED; |
105 | if (!(tn->flags & SYMBIOS_SCAN_AT_BOOT_TIME)) | 103 | if (!(tn->flags & SYMBIOS_SCAN_AT_BOOT_TIME)) |
106 | tp->usrflags |= SYM_SCAN_BOOT_DISABLED; | 104 | tp->usrflags |= SYM_SCAN_BOOT_DISABLED; |
107 | if (!(tn->flags & SYMBIOS_SCAN_LUNS)) | 105 | if (!(tn->flags & SYMBIOS_SCAN_LUNS)) |
108 | tp->usrflags |= SYM_SCAN_LUNS_DISABLED; | 106 | tp->usrflags |= SYM_SCAN_LUNS_DISABLED; |
107 | tp->usr_period = (tn->sync_period + 3) / 4; | ||
108 | tp->usr_width = (tn->bus_width == 0x8) ? 0 : 1; | ||
109 | } | 109 | } |
110 | 110 | ||
111 | static const unsigned char Tekram_sync[16] = { | ||
112 | 25, 31, 37, 43, 50, 62, 75, 125, 12, 15, 18, 21, 6, 7, 9, 10 | ||
113 | }; | ||
114 | |||
111 | /* | 115 | /* |
112 | * Get target set-up from Tekram format NVRAM. | 116 | * Get target set-up from Tekram format NVRAM. |
113 | */ | 117 | */ |
114 | static void | 118 | static void |
115 | sym_Tekram_setup_target(struct sym_hcb *np, int target, Tekram_nvram *nvram) | 119 | sym_Tekram_setup_target(struct sym_tcb *tp, int target, Tekram_nvram *nvram) |
116 | { | 120 | { |
117 | struct sym_tcb *tp = &np->target[target]; | ||
118 | struct Tekram_target *tn = &nvram->target[target]; | 121 | struct Tekram_target *tn = &nvram->target[target]; |
119 | 122 | ||
120 | if (tn->flags & TEKRAM_TAGGED_COMMANDS) { | 123 | if (tn->flags & TEKRAM_TAGGED_COMMANDS) { |
@@ -124,22 +127,22 @@ sym_Tekram_setup_target(struct sym_hcb *np, int target, Tekram_nvram *nvram) | |||
124 | if (tn->flags & TEKRAM_DISCONNECT_ENABLE) | 127 | if (tn->flags & TEKRAM_DISCONNECT_ENABLE) |
125 | tp->usrflags |= SYM_DISC_ENABLED; | 128 | tp->usrflags |= SYM_DISC_ENABLED; |
126 | 129 | ||
127 | /* If any device does not support parity, we will not use this option */ | 130 | if (tn->flags & TEKRAM_SYNC_NEGO) |
128 | if (!(tn->flags & TEKRAM_PARITY_CHECK)) | 131 | tp->usr_period = Tekram_sync[tn->sync_index & 0xf]; |
129 | np->rv_scntl0 &= ~0x0a; /* SCSI parity checking disabled */ | 132 | tp->usr_width = (tn->flags & TEKRAM_WIDE_NEGO) ? 1 : 0; |
130 | } | 133 | } |
131 | 134 | ||
132 | /* | 135 | /* |
133 | * Get target setup from NVRAM. | 136 | * Get target setup from NVRAM. |
134 | */ | 137 | */ |
135 | void sym_nvram_setup_target(struct sym_hcb *np, int target, struct sym_nvram *nvp) | 138 | void sym_nvram_setup_target(struct sym_tcb *tp, int target, struct sym_nvram *nvp) |
136 | { | 139 | { |
137 | switch (nvp->type) { | 140 | switch (nvp->type) { |
138 | case SYM_SYMBIOS_NVRAM: | 141 | case SYM_SYMBIOS_NVRAM: |
139 | sym_Symbios_setup_target(np, target, &nvp->data.Symbios); | 142 | sym_Symbios_setup_target(tp, target, &nvp->data.Symbios); |
140 | break; | 143 | break; |
141 | case SYM_TEKRAM_NVRAM: | 144 | case SYM_TEKRAM_NVRAM: |
142 | sym_Tekram_setup_target(np, target, &nvp->data.Tekram); | 145 | sym_Tekram_setup_target(tp, target, &nvp->data.Tekram); |
143 | break; | 146 | break; |
144 | default: | 147 | default: |
145 | break; | 148 | break; |