Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

switch wd33c93 to ->show_info()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 408bb25b cab29b99

+94 -115
+2 -1
drivers/scsi/a2091.c
··· 166 166 static struct scsi_host_template a2091_scsi_template = { 167 167 .module = THIS_MODULE, 168 168 .name = "Commodore A2091/A590 SCSI", 169 - .proc_info = wd33c93_proc_info, 169 + .show_info = wd33c93_show_info, 170 + .write_info = wd33c93_write_info, 170 171 .proc_name = "A2901", 171 172 .queuecommand = wd33c93_queuecommand, 172 173 .eh_abort_handler = wd33c93_abort,
+2 -1
drivers/scsi/a3000.c
··· 181 181 static struct scsi_host_template amiga_a3000_scsi_template = { 182 182 .module = THIS_MODULE, 183 183 .name = "Amiga 3000 built-in SCSI", 184 - .proc_info = wd33c93_proc_info, 184 + .show_info = wd33c93_show_info, 185 + .write_info = wd33c93_write_info, 185 186 .proc_name = "A3000", 186 187 .queuecommand = wd33c93_queuecommand, 187 188 .eh_abort_handler = wd33c93_abort,
+2 -1
drivers/scsi/gvp11.c
··· 191 191 static struct scsi_host_template gvp11_scsi_template = { 192 192 .module = THIS_MODULE, 193 193 .name = "GVP Series II SCSI", 194 - .proc_info = wd33c93_proc_info, 194 + .show_info = wd33c93_show_info, 195 + .write_info = wd33c93_write_info, 195 196 .proc_name = "GVP11", 196 197 .queuecommand = wd33c93_queuecommand, 197 198 .eh_abort_handler = wd33c93_abort,
+2 -1
drivers/scsi/mvme147.c
··· 76 76 called++; 77 77 78 78 tpnt->proc_name = "MVME147"; 79 - tpnt->proc_info = &wd33c93_proc_info; 79 + tpnt->show_info = wd33c93_show_info, 80 + tpnt->write_info = wd33c93_write_info, 80 81 81 82 instance = scsi_register(tpnt, sizeof(struct WD33C93_hostdata)); 82 83 if (!instance)
+84 -110
drivers/scsi/wd33c93.c
··· 2054 2054 printk(" Version %s - %s\n", WD33C93_VERSION, WD33C93_DATE); 2055 2055 } 2056 2056 2057 - int 2058 - wd33c93_proc_info(struct Scsi_Host *instance, char *buf, char **start, off_t off, int len, int in) 2057 + int wd33c93_write_info(struct Scsi_Host *instance, char *buf, int len) 2059 2058 { 2060 - 2061 2059 #ifdef PROC_INTERFACE 2062 - 2063 2060 char *bp; 2064 - char tbuf[128]; 2065 2061 struct WD33C93_hostdata *hd; 2066 - struct scsi_cmnd *cmd; 2067 2062 int x; 2068 - static int stop = 0; 2069 2063 2070 2064 hd = (struct WD33C93_hostdata *) instance->hostdata; 2071 2065 2072 - /* If 'in' is TRUE we need to _read_ the proc file. We accept the following 2066 + /* We accept the following 2073 2067 * keywords (same format as command-line, but arguments are not optional): 2074 2068 * debug 2075 2069 * disconnect ··· 2077 2083 * nosync 2078 2084 */ 2079 2085 2080 - if (in) { 2081 - buf[len] = '\0'; 2082 - for (bp = buf; *bp; ) { 2083 - while (',' == *bp || ' ' == *bp) 2084 - ++bp; 2085 - if (!strncmp(bp, "debug:", 6)) { 2086 - hd->args = simple_strtoul(bp+6, &bp, 0) & DB_MASK; 2087 - } else if (!strncmp(bp, "disconnect:", 11)) { 2088 - x = simple_strtoul(bp+11, &bp, 0); 2089 - if (x < DIS_NEVER || x > DIS_ALWAYS) 2090 - x = DIS_ADAPTIVE; 2091 - hd->disconnect = x; 2092 - } else if (!strncmp(bp, "period:", 7)) { 2086 + buf[len] = '\0'; 2087 + for (bp = buf; *bp; ) { 2088 + while (',' == *bp || ' ' == *bp) 2089 + ++bp; 2090 + if (!strncmp(bp, "debug:", 6)) { 2091 + hd->args = simple_strtoul(bp+6, &bp, 0) & DB_MASK; 2092 + } else if (!strncmp(bp, "disconnect:", 11)) { 2093 + x = simple_strtoul(bp+11, &bp, 0); 2094 + if (x < DIS_NEVER || x > DIS_ALWAYS) 2095 + x = DIS_ADAPTIVE; 2096 + hd->disconnect = x; 2097 + } else if (!strncmp(bp, "period:", 7)) { 2098 + x = simple_strtoul(bp+7, &bp, 0); 2099 + hd->default_sx_per = 2100 + hd->sx_table[round_period((unsigned int) x, 2101 + hd->sx_table)].period_ns; 2102 + } else if (!strncmp(bp, "resync:", 7)) { 2103 + set_resync(hd, (int)simple_strtoul(bp+7, &bp, 0)); 2104 + } else if (!strncmp(bp, "proc:", 5)) { 2105 + hd->proc = simple_strtoul(bp+5, &bp, 0); 2106 + } else if (!strncmp(bp, "nodma:", 6)) { 2107 + hd->no_dma = simple_strtoul(bp+6, &bp, 0); 2108 + } else if (!strncmp(bp, "level2:", 7)) { 2109 + hd->level2 = simple_strtoul(bp+7, &bp, 0); 2110 + } else if (!strncmp(bp, "burst:", 6)) { 2111 + hd->dma_mode = 2112 + simple_strtol(bp+6, &bp, 0) ? CTRL_BURST:CTRL_DMA; 2113 + } else if (!strncmp(bp, "fast:", 5)) { 2114 + x = !!simple_strtol(bp+5, &bp, 0); 2115 + if (x != hd->fast) 2116 + set_resync(hd, 0xff); 2117 + hd->fast = x; 2118 + } else if (!strncmp(bp, "nosync:", 7)) { 2093 2119 x = simple_strtoul(bp+7, &bp, 0); 2094 - hd->default_sx_per = 2095 - hd->sx_table[round_period((unsigned int) x, 2096 - hd->sx_table)].period_ns; 2097 - } else if (!strncmp(bp, "resync:", 7)) { 2098 - set_resync(hd, (int)simple_strtoul(bp+7, &bp, 0)); 2099 - } else if (!strncmp(bp, "proc:", 5)) { 2100 - hd->proc = simple_strtoul(bp+5, &bp, 0); 2101 - } else if (!strncmp(bp, "nodma:", 6)) { 2102 - hd->no_dma = simple_strtoul(bp+6, &bp, 0); 2103 - } else if (!strncmp(bp, "level2:", 7)) { 2104 - hd->level2 = simple_strtoul(bp+7, &bp, 0); 2105 - } else if (!strncmp(bp, "burst:", 6)) { 2106 - hd->dma_mode = 2107 - simple_strtol(bp+6, &bp, 0) ? CTRL_BURST:CTRL_DMA; 2108 - } else if (!strncmp(bp, "fast:", 5)) { 2109 - x = !!simple_strtol(bp+5, &bp, 0); 2110 - if (x != hd->fast) 2111 - set_resync(hd, 0xff); 2112 - hd->fast = x; 2113 - } else if (!strncmp(bp, "nosync:", 7)) { 2114 - x = simple_strtoul(bp+7, &bp, 0); 2115 - set_resync(hd, x ^ hd->no_sync); 2116 - hd->no_sync = x; 2117 - } else { 2118 - break; /* unknown keyword,syntax-error,... */ 2119 - } 2120 + set_resync(hd, x ^ hd->no_sync); 2121 + hd->no_sync = x; 2122 + } else { 2123 + break; /* unknown keyword,syntax-error,... */ 2120 2124 } 2121 - return len; 2122 2125 } 2126 + return len; 2127 + #else 2128 + return 0; 2129 + #endif 2130 + } 2131 + 2132 + int 2133 + wd33c93_show_info(struct seq_file *m, struct Scsi_Host *instance) 2134 + { 2135 + #ifdef PROC_INTERFACE 2136 + struct WD33C93_hostdata *hd; 2137 + struct scsi_cmnd *cmd; 2138 + int x; 2139 + 2140 + hd = (struct WD33C93_hostdata *) instance->hostdata; 2123 2141 2124 2142 spin_lock_irq(&hd->lock); 2125 - bp = buf; 2126 - *bp = '\0'; 2127 - if (hd->proc & PR_VERSION) { 2128 - sprintf(tbuf, "\nVersion %s - %s.", 2143 + if (hd->proc & PR_VERSION) 2144 + seq_printf(m, "\nVersion %s - %s.", 2129 2145 WD33C93_VERSION, WD33C93_DATE); 2130 - strcat(bp, tbuf); 2131 - } 2146 + 2132 2147 if (hd->proc & PR_INFO) { 2133 - sprintf(tbuf, "\nclock_freq=%02x no_sync=%02x no_dma=%d" 2148 + seq_printf(m, "\nclock_freq=%02x no_sync=%02x no_dma=%d" 2134 2149 " dma_mode=%02x fast=%d", 2135 2150 hd->clock_freq, hd->no_sync, hd->no_dma, hd->dma_mode, hd->fast); 2136 - strcat(bp, tbuf); 2137 - strcat(bp, "\nsync_xfer[] = "); 2138 - for (x = 0; x < 7; x++) { 2139 - sprintf(tbuf, "\t%02x", hd->sync_xfer[x]); 2140 - strcat(bp, tbuf); 2141 - } 2142 - strcat(bp, "\nsync_stat[] = "); 2143 - for (x = 0; x < 7; x++) { 2144 - sprintf(tbuf, "\t%02x", hd->sync_stat[x]); 2145 - strcat(bp, tbuf); 2146 - } 2151 + seq_printf(m, "\nsync_xfer[] = "); 2152 + for (x = 0; x < 7; x++) 2153 + seq_printf(m, "\t%02x", hd->sync_xfer[x]); 2154 + seq_printf(m, "\nsync_stat[] = "); 2155 + for (x = 0; x < 7; x++) 2156 + seq_printf(m, "\t%02x", hd->sync_stat[x]); 2147 2157 } 2148 2158 #ifdef PROC_STATISTICS 2149 2159 if (hd->proc & PR_STATISTICS) { 2150 - strcat(bp, "\ncommands issued: "); 2151 - for (x = 0; x < 7; x++) { 2152 - sprintf(tbuf, "\t%ld", hd->cmd_cnt[x]); 2153 - strcat(bp, tbuf); 2154 - } 2155 - strcat(bp, "\ndisconnects allowed:"); 2156 - for (x = 0; x < 7; x++) { 2157 - sprintf(tbuf, "\t%ld", hd->disc_allowed_cnt[x]); 2158 - strcat(bp, tbuf); 2159 - } 2160 - strcat(bp, "\ndisconnects done: "); 2161 - for (x = 0; x < 7; x++) { 2162 - sprintf(tbuf, "\t%ld", hd->disc_done_cnt[x]); 2163 - strcat(bp, tbuf); 2164 - } 2165 - sprintf(tbuf, 2160 + seq_printf(m, "\ncommands issued: "); 2161 + for (x = 0; x < 7; x++) 2162 + seq_printf(m, "\t%ld", hd->cmd_cnt[x]); 2163 + seq_printf(m, "\ndisconnects allowed:"); 2164 + for (x = 0; x < 7; x++) 2165 + seq_printf(m, "\t%ld", hd->disc_allowed_cnt[x]); 2166 + seq_printf(m, "\ndisconnects done: "); 2167 + for (x = 0; x < 7; x++) 2168 + seq_printf(m, "\t%ld", hd->disc_done_cnt[x]); 2169 + seq_printf(m, 2166 2170 "\ninterrupts: %ld, DATA_PHASE ints: %ld DMA, %ld PIO", 2167 2171 hd->int_cnt, hd->dma_cnt, hd->pio_cnt); 2168 - strcat(bp, tbuf); 2169 2172 } 2170 2173 #endif 2171 2174 if (hd->proc & PR_CONNECTED) { 2172 - strcat(bp, "\nconnected: "); 2175 + seq_printf(m, "\nconnected: "); 2173 2176 if (hd->connected) { 2174 2177 cmd = (struct scsi_cmnd *) hd->connected; 2175 - sprintf(tbuf, " %d:%d(%02x)", 2178 + seq_printf(m, " %d:%d(%02x)", 2176 2179 cmd->device->id, cmd->device->lun, cmd->cmnd[0]); 2177 - strcat(bp, tbuf); 2178 2180 } 2179 2181 } 2180 2182 if (hd->proc & PR_INPUTQ) { 2181 - strcat(bp, "\ninput_Q: "); 2183 + seq_printf(m, "\ninput_Q: "); 2182 2184 cmd = (struct scsi_cmnd *) hd->input_Q; 2183 2185 while (cmd) { 2184 - sprintf(tbuf, " %d:%d(%02x)", 2186 + seq_printf(m, " %d:%d(%02x)", 2185 2187 cmd->device->id, cmd->device->lun, cmd->cmnd[0]); 2186 - strcat(bp, tbuf); 2187 2188 cmd = (struct scsi_cmnd *) cmd->host_scribble; 2188 2189 } 2189 2190 } 2190 2191 if (hd->proc & PR_DISCQ) { 2191 - strcat(bp, "\ndisconnected_Q:"); 2192 + seq_printf(m, "\ndisconnected_Q:"); 2192 2193 cmd = (struct scsi_cmnd *) hd->disconnected_Q; 2193 2194 while (cmd) { 2194 - sprintf(tbuf, " %d:%d(%02x)", 2195 + seq_printf(m, " %d:%d(%02x)", 2195 2196 cmd->device->id, cmd->device->lun, cmd->cmnd[0]); 2196 - strcat(bp, tbuf); 2197 2197 cmd = (struct scsi_cmnd *) cmd->host_scribble; 2198 2198 } 2199 2199 } 2200 - strcat(bp, "\n"); 2200 + seq_printf(m, "\n"); 2201 2201 spin_unlock_irq(&hd->lock); 2202 - *start = buf; 2203 - if (stop) { 2204 - stop = 0; 2205 - return 0; 2206 - } 2207 - if (off > 0x40000) /* ALWAYS stop after 256k bytes have been read */ 2208 - stop = 1; 2209 - if (hd->proc & PR_STOP) /* stop every other time */ 2210 - stop = 1; 2211 - return strlen(bp); 2212 - 2213 - #else /* PROC_INTERFACE */ 2214 - 2215 - return 0; 2216 - 2217 2202 #endif /* PROC_INTERFACE */ 2218 - 2203 + return 0; 2219 2204 } 2220 2205 2221 2206 EXPORT_SYMBOL(wd33c93_host_reset); ··· 2202 2229 EXPORT_SYMBOL(wd33c93_abort); 2203 2230 EXPORT_SYMBOL(wd33c93_queuecommand); 2204 2231 EXPORT_SYMBOL(wd33c93_intr); 2205 - EXPORT_SYMBOL(wd33c93_proc_info); 2232 + EXPORT_SYMBOL(wd33c93_show_info); 2233 + EXPORT_SYMBOL(wd33c93_write_info);
+2 -1
drivers/scsi/wd33c93.h
··· 345 345 int wd33c93_abort (struct scsi_cmnd *cmd); 346 346 int wd33c93_queuecommand (struct Scsi_Host *h, struct scsi_cmnd *cmd); 347 347 void wd33c93_intr (struct Scsi_Host *instance); 348 - int wd33c93_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int); 348 + int wd33c93_show_info(struct seq_file *, struct Scsi_Host *); 349 + int wd33c93_write_info(struct Scsi_Host *, char *, int); 349 350 int wd33c93_host_reset (struct scsi_cmnd *); 350 351 351 352 #endif /* WD33C93_H */