version 1.46, 2013/10/17 21:24:24 |
version 1.47, 2014/03/27 18:28:26 |
Line 5963 ahd_controller_info(struct ahd_softc *ah |
|
Line 5963 ahd_controller_info(struct ahd_softc *ah |
|
{ |
{ |
const char *speed; |
const char *speed; |
const char *type; |
const char *type; |
int len; |
size_t len; |
char *ep; |
|
|
|
ep = tbuf + l; |
len = snprintf(tbuf, l, "%s: ", |
|
|
len = snprintf(tbuf, ep - tbuf, "%s: ", |
|
ahd_chip_names[ahd->chip & AHD_CHIPID_MASK]); |
ahd_chip_names[ahd->chip & AHD_CHIPID_MASK]); |
tbuf += len; |
if (len > l) |
|
return; |
speed = "Ultra320 "; |
speed = "Ultra320 "; |
if ((ahd->features & AHD_WIDE) != 0) { |
if ((ahd->features & AHD_WIDE) != 0) { |
type = "Wide "; |
type = "Wide "; |
} else { |
} else { |
type = "Single "; |
type = "Single "; |
} |
} |
len = snprintf(tbuf, ep - tbuf, "%s%sChannel %c, SCSI Id=%d, ", |
len += snprintf(tbuf + len, l - len, "%s%sChannel %c, SCSI Id=%d, ", |
speed, type, ahd->channel, ahd->our_id); |
speed, type, ahd->channel, ahd->our_id); |
tbuf += len; |
if (len > l) |
|
return; |
snprintf(tbuf, ep - tbuf, "%s, %d SCBs", ahd->bus_description, |
snprintf(tbuf + len, l - len, "%s, %d SCBs", ahd->bus_description, |
ahd->scb_data.maxhscbs); |
ahd->scb_data.maxhscbs); |
} |
} |
|
|
Line 8597 ahd_print_register(ahd_reg_parse_entry_t |
|
Line 8594 ahd_print_register(ahd_reg_parse_entry_t |
|
const char *name, u_int address, u_int value, |
const char *name, u_int address, u_int value, |
u_int *cur_column, u_int wrap_point) |
u_int *cur_column, u_int wrap_point) |
{ |
{ |
int printed; |
size_t printed; |
u_int printed_mask; |
u_int printed_mask; |
char line[1024]; |
char line[1024]; |
|
|
Line 8608 ahd_print_register(ahd_reg_parse_entry_t |
|
Line 8605 ahd_print_register(ahd_reg_parse_entry_t |
|
*cur_column = 0; |
*cur_column = 0; |
} |
} |
printed = snprintf(line, sizeof(line), "%s[0x%x]", name, value); |
printed = snprintf(line, sizeof(line), "%s[0x%x]", name, value); |
|
if (printed > sizeof(line)) |
|
printed = sizeof(line); |
if (table == NULL) { |
if (table == NULL) { |
printed += snprintf(&line[printed], (sizeof line) - printed, |
printed += snprintf(&line[printed], (sizeof line) - printed, |
" "); |
" "); |
|
if (printed > sizeof(line)) |
|
printed = sizeof(line); |
printf("%s", line); |
printf("%s", line); |
if (cur_column != NULL) |
if (cur_column != NULL) |
*cur_column += printed; |
*cur_column += printed; |
Line 8626 ahd_print_register(ahd_reg_parse_entry_t |
|
Line 8627 ahd_print_register(ahd_reg_parse_entry_t |
|
|| ((printed_mask & table[entry].mask) |
|| ((printed_mask & table[entry].mask) |
== table[entry].mask)) |
== table[entry].mask)) |
continue; |
continue; |
|
if (printed > sizeof(line)) |
|
printed = sizeof(line); |
printed += snprintf(&line[printed], |
printed += snprintf(&line[printed], |
(sizeof line) - printed, "%s%s", |
(sizeof line) - printed, "%s%s", |
printed_mask == 0 ? ":(" : "|", |
printed_mask == 0 ? ":(" : "|", |
Line 8637 ahd_print_register(ahd_reg_parse_entry_t |
|
Line 8640 ahd_print_register(ahd_reg_parse_entry_t |
|
if (entry >= num_entries) |
if (entry >= num_entries) |
break; |
break; |
} |
} |
|
if (printed > sizeof(line)) |
|
printed = sizeof(line); |
if (printed_mask != 0) |
if (printed_mask != 0) |
printed += snprintf(&line[printed], |
printed += snprintf(&line[printed], |
(sizeof line) - printed, ") "); |
(sizeof line) - printed, ") "); |