diff options
author | Pekka Enberg <penberg@cs.helsinki.fi> | 2010-07-14 06:12:57 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-28 10:05:27 -0400 |
commit | 48813cf989eb8695fe84df30207fc8ff5f15783c (patch) | |
tree | 031eb09af4f435faa285f863416bece80e9d2193 /drivers/scsi/aic7xxx | |
parent | 660bdddb52843d361e47c30294366ae0deac821b (diff) |
[SCSI] aic7xxx: Remove OS utility wrappers
This patch removes malloc(), free(), and printf() wrappers from the aic7xxx
SCSI driver. I didn't use pr_debug for printf because of some 'clever' uses of
printf don't compile with the pr_debug. I didn't fix the overeager uses of
GFP_ATOMIC either because I wanted to keep this patch as simple as possible.
[jejb:fixed up checkpatch errors and fixed up missed conversion]
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/aic7xxx')
-rw-r--r-- | drivers/scsi/aic7xxx/aic7770.c | 12 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic7770_osm.c | 2 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_core.c | 624 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_osm.c | 108 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_osm.h | 7 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_osm_pci.c | 8 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_pci.c | 56 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_proc.c | 13 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx_93cx6.c | 10 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx_core.c | 430 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx_osm.c | 76 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx_osm.h | 7 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx_osm_pci.c | 8 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx_pci.c | 74 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx_proc.c | 15 |
15 files changed, 712 insertions, 738 deletions
diff --git a/drivers/scsi/aic7xxx/aic7770.c b/drivers/scsi/aic7xxx/aic7770.c index 6d86a9be538f..5000bd69c13f 100644 --- a/drivers/scsi/aic7xxx/aic7770.c +++ b/drivers/scsi/aic7xxx/aic7770.c | |||
@@ -170,7 +170,7 @@ aic7770_config(struct ahc_softc *ahc, struct aic7770_identity *entry, u_int io) | |||
170 | case 15: | 170 | case 15: |
171 | break; | 171 | break; |
172 | default: | 172 | default: |
173 | printf("aic7770_config: invalid irq setting %d\n", intdef); | 173 | printk("aic7770_config: invalid irq setting %d\n", intdef); |
174 | return (ENXIO); | 174 | return (ENXIO); |
175 | } | 175 | } |
176 | 176 | ||
@@ -221,7 +221,7 @@ aic7770_config(struct ahc_softc *ahc, struct aic7770_identity *entry, u_int io) | |||
221 | break; | 221 | break; |
222 | } | 222 | } |
223 | if (have_seeprom == 0) { | 223 | if (have_seeprom == 0) { |
224 | free(ahc->seep_config, M_DEVBUF); | 224 | kfree(ahc->seep_config); |
225 | ahc->seep_config = NULL; | 225 | ahc->seep_config = NULL; |
226 | } | 226 | } |
227 | 227 | ||
@@ -293,7 +293,7 @@ aha2840_load_seeprom(struct ahc_softc *ahc) | |||
293 | sc = ahc->seep_config; | 293 | sc = ahc->seep_config; |
294 | 294 | ||
295 | if (bootverbose) | 295 | if (bootverbose) |
296 | printf("%s: Reading SEEPROM...", ahc_name(ahc)); | 296 | printk("%s: Reading SEEPROM...", ahc_name(ahc)); |
297 | have_seeprom = ahc_read_seeprom(&sd, (uint16_t *)sc, | 297 | have_seeprom = ahc_read_seeprom(&sd, (uint16_t *)sc, |
298 | /*start_addr*/0, sizeof(*sc)/2); | 298 | /*start_addr*/0, sizeof(*sc)/2); |
299 | 299 | ||
@@ -301,16 +301,16 @@ aha2840_load_seeprom(struct ahc_softc *ahc) | |||
301 | 301 | ||
302 | if (ahc_verify_cksum(sc) == 0) { | 302 | if (ahc_verify_cksum(sc) == 0) { |
303 | if(bootverbose) | 303 | if(bootverbose) |
304 | printf ("checksum error\n"); | 304 | printk ("checksum error\n"); |
305 | have_seeprom = 0; | 305 | have_seeprom = 0; |
306 | } else if (bootverbose) { | 306 | } else if (bootverbose) { |
307 | printf("done.\n"); | 307 | printk("done.\n"); |
308 | } | 308 | } |
309 | } | 309 | } |
310 | 310 | ||
311 | if (!have_seeprom) { | 311 | if (!have_seeprom) { |
312 | if (bootverbose) | 312 | if (bootverbose) |
313 | printf("%s: No SEEPROM available\n", ahc_name(ahc)); | 313 | printk("%s: No SEEPROM available\n", ahc_name(ahc)); |
314 | ahc->flags |= AHC_USEDEFAULTS; | 314 | ahc->flags |= AHC_USEDEFAULTS; |
315 | } else { | 315 | } else { |
316 | /* | 316 | /* |
diff --git a/drivers/scsi/aic7xxx/aic7770_osm.c b/drivers/scsi/aic7xxx/aic7770_osm.c index f220e5e436ab..0cb8ef64b5ce 100644 --- a/drivers/scsi/aic7xxx/aic7770_osm.c +++ b/drivers/scsi/aic7xxx/aic7770_osm.c | |||
@@ -85,7 +85,7 @@ aic7770_probe(struct device *dev) | |||
85 | int error; | 85 | int error; |
86 | 86 | ||
87 | sprintf(buf, "ahc_eisa:%d", eisaBase >> 12); | 87 | sprintf(buf, "ahc_eisa:%d", eisaBase >> 12); |
88 | name = malloc(strlen(buf) + 1, M_DEVBUF, M_NOWAIT); | 88 | name = kmalloc(strlen(buf) + 1, GFP_ATOMIC); |
89 | if (name == NULL) | 89 | if (name == NULL) |
90 | return (ENOMEM); | 90 | return (ENOMEM); |
91 | strcpy(name, buf); | 91 | strcpy(name, buf); |
diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c index 78971db5b60e..3233bf564435 100644 --- a/drivers/scsi/aic7xxx/aic79xx_core.c +++ b/drivers/scsi/aic7xxx/aic79xx_core.c | |||
@@ -289,7 +289,7 @@ ahd_set_modes(struct ahd_softc *ahd, ahd_mode src, ahd_mode dst) | |||
289 | || ahd->dst_mode == AHD_MODE_UNKNOWN) | 289 | || ahd->dst_mode == AHD_MODE_UNKNOWN) |
290 | panic("Setting mode prior to saving it.\n"); | 290 | panic("Setting mode prior to saving it.\n"); |
291 | if ((ahd_debug & AHD_SHOW_MODEPTR) != 0) | 291 | if ((ahd_debug & AHD_SHOW_MODEPTR) != 0) |
292 | printf("%s: Setting mode 0x%x\n", ahd_name(ahd), | 292 | printk("%s: Setting mode 0x%x\n", ahd_name(ahd), |
293 | ahd_build_mode_state(ahd, src, dst)); | 293 | ahd_build_mode_state(ahd, src, dst)); |
294 | #endif | 294 | #endif |
295 | ahd_outb(ahd, MODE_PTR, ahd_build_mode_state(ahd, src, dst)); | 295 | ahd_outb(ahd, MODE_PTR, ahd_build_mode_state(ahd, src, dst)); |
@@ -307,7 +307,7 @@ ahd_update_modes(struct ahd_softc *ahd) | |||
307 | mode_ptr = ahd_inb(ahd, MODE_PTR); | 307 | mode_ptr = ahd_inb(ahd, MODE_PTR); |
308 | #ifdef AHD_DEBUG | 308 | #ifdef AHD_DEBUG |
309 | if ((ahd_debug & AHD_SHOW_MODEPTR) != 0) | 309 | if ((ahd_debug & AHD_SHOW_MODEPTR) != 0) |
310 | printf("Reading mode 0x%x\n", mode_ptr); | 310 | printk("Reading mode 0x%x\n", mode_ptr); |
311 | #endif | 311 | #endif |
312 | ahd_extract_mode_state(ahd, mode_ptr, &src, &dst); | 312 | ahd_extract_mode_state(ahd, mode_ptr, &src, &dst); |
313 | ahd_known_modes(ahd, src, dst); | 313 | ahd_known_modes(ahd, src, dst); |
@@ -877,7 +877,7 @@ ahd_queue_scb(struct ahd_softc *ahd, struct scb *scb) | |||
877 | uint64_t host_dataptr; | 877 | uint64_t host_dataptr; |
878 | 878 | ||
879 | host_dataptr = ahd_le64toh(scb->hscb->dataptr); | 879 | host_dataptr = ahd_le64toh(scb->hscb->dataptr); |
880 | printf("%s: Queueing SCB %d:0x%x bus addr 0x%x - 0x%x%x/0x%x\n", | 880 | printk("%s: Queueing SCB %d:0x%x bus addr 0x%x - 0x%x%x/0x%x\n", |
881 | ahd_name(ahd), | 881 | ahd_name(ahd), |
882 | SCB_GET_TAG(scb), scb->hscb->scsiid, | 882 | SCB_GET_TAG(scb), scb->hscb->scsiid, |
883 | ahd_le32toh(scb->hscb->hscb_busaddr), | 883 | ahd_le32toh(scb->hscb->hscb_busaddr), |
@@ -1174,7 +1174,7 @@ ahd_clear_fifo(struct ahd_softc *ahd, u_int fifo) | |||
1174 | 1174 | ||
1175 | #ifdef AHD_DEBUG | 1175 | #ifdef AHD_DEBUG |
1176 | if ((ahd_debug & AHD_SHOW_FIFOS) != 0) | 1176 | if ((ahd_debug & AHD_SHOW_FIFOS) != 0) |
1177 | printf("%s: Clearing FIFO %d\n", ahd_name(ahd), fifo); | 1177 | printk("%s: Clearing FIFO %d\n", ahd_name(ahd), fifo); |
1178 | #endif | 1178 | #endif |
1179 | saved_modes = ahd_save_modes(ahd); | 1179 | saved_modes = ahd_save_modes(ahd); |
1180 | ahd_set_modes(ahd, fifo, fifo); | 1180 | ahd_set_modes(ahd, fifo, fifo); |
@@ -1215,7 +1215,7 @@ ahd_flush_qoutfifo(struct ahd_softc *ahd) | |||
1215 | scbid = ahd_inw(ahd, GSFIFO); | 1215 | scbid = ahd_inw(ahd, GSFIFO); |
1216 | scb = ahd_lookup_scb(ahd, scbid); | 1216 | scb = ahd_lookup_scb(ahd, scbid); |
1217 | if (scb == NULL) { | 1217 | if (scb == NULL) { |
1218 | printf("%s: Warning - GSFIFO SCB %d invalid\n", | 1218 | printk("%s: Warning - GSFIFO SCB %d invalid\n", |
1219 | ahd_name(ahd), scbid); | 1219 | ahd_name(ahd), scbid); |
1220 | continue; | 1220 | continue; |
1221 | } | 1221 | } |
@@ -1339,7 +1339,7 @@ rescan_fifos: | |||
1339 | next_scbid = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE); | 1339 | next_scbid = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE); |
1340 | scb = ahd_lookup_scb(ahd, scbid); | 1340 | scb = ahd_lookup_scb(ahd, scbid); |
1341 | if (scb == NULL) { | 1341 | if (scb == NULL) { |
1342 | printf("%s: Warning - DMA-up and complete " | 1342 | printk("%s: Warning - DMA-up and complete " |
1343 | "SCB %d invalid\n", ahd_name(ahd), scbid); | 1343 | "SCB %d invalid\n", ahd_name(ahd), scbid); |
1344 | continue; | 1344 | continue; |
1345 | } | 1345 | } |
@@ -1360,7 +1360,7 @@ rescan_fifos: | |||
1360 | next_scbid = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE); | 1360 | next_scbid = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE); |
1361 | scb = ahd_lookup_scb(ahd, scbid); | 1361 | scb = ahd_lookup_scb(ahd, scbid); |
1362 | if (scb == NULL) { | 1362 | if (scb == NULL) { |
1363 | printf("%s: Warning - Complete Qfrz SCB %d invalid\n", | 1363 | printk("%s: Warning - Complete Qfrz SCB %d invalid\n", |
1364 | ahd_name(ahd), scbid); | 1364 | ahd_name(ahd), scbid); |
1365 | continue; | 1365 | continue; |
1366 | } | 1366 | } |
@@ -1377,7 +1377,7 @@ rescan_fifos: | |||
1377 | next_scbid = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE); | 1377 | next_scbid = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE); |
1378 | scb = ahd_lookup_scb(ahd, scbid); | 1378 | scb = ahd_lookup_scb(ahd, scbid); |
1379 | if (scb == NULL) { | 1379 | if (scb == NULL) { |
1380 | printf("%s: Warning - Complete SCB %d invalid\n", | 1380 | printk("%s: Warning - Complete SCB %d invalid\n", |
1381 | ahd_name(ahd), scbid); | 1381 | ahd_name(ahd), scbid); |
1382 | continue; | 1382 | continue; |
1383 | } | 1383 | } |
@@ -1682,7 +1682,7 @@ ahd_run_qoutfifo(struct ahd_softc *ahd) | |||
1682 | scb_index = ahd_le16toh(completion->tag); | 1682 | scb_index = ahd_le16toh(completion->tag); |
1683 | scb = ahd_lookup_scb(ahd, scb_index); | 1683 | scb = ahd_lookup_scb(ahd, scb_index); |
1684 | if (scb == NULL) { | 1684 | if (scb == NULL) { |
1685 | printf("%s: WARNING no command for scb %d " | 1685 | printk("%s: WARNING no command for scb %d " |
1686 | "(cmdcmplt)\nQOUTPOS = %d\n", | 1686 | "(cmdcmplt)\nQOUTPOS = %d\n", |
1687 | ahd_name(ahd), scb_index, | 1687 | ahd_name(ahd), scb_index, |
1688 | ahd->qoutfifonext); | 1688 | ahd->qoutfifonext); |
@@ -1714,7 +1714,7 @@ ahd_handle_hwerrint(struct ahd_softc *ahd) | |||
1714 | error = ahd_inb(ahd, ERROR); | 1714 | error = ahd_inb(ahd, ERROR); |
1715 | for (i = 0; i < num_errors; i++) { | 1715 | for (i = 0; i < num_errors; i++) { |
1716 | if ((error & ahd_hard_errors[i].errno) != 0) | 1716 | if ((error & ahd_hard_errors[i].errno) != 0) |
1717 | printf("%s: hwerrint, %s\n", | 1717 | printk("%s: hwerrint, %s\n", |
1718 | ahd_name(ahd), ahd_hard_errors[i].errmesg); | 1718 | ahd_name(ahd), ahd_hard_errors[i].errmesg); |
1719 | } | 1719 | } |
1720 | 1720 | ||
@@ -1747,7 +1747,7 @@ ahd_dump_sglist(struct scb *scb) | |||
1747 | 1747 | ||
1748 | addr = ahd_le64toh(sg_list[i].addr); | 1748 | addr = ahd_le64toh(sg_list[i].addr); |
1749 | len = ahd_le32toh(sg_list[i].len); | 1749 | len = ahd_le32toh(sg_list[i].len); |
1750 | printf("sg[%d] - Addr 0x%x%x : Length %d%s\n", | 1750 | printk("sg[%d] - Addr 0x%x%x : Length %d%s\n", |
1751 | i, | 1751 | i, |
1752 | (uint32_t)((addr >> 32) & 0xFFFFFFFF), | 1752 | (uint32_t)((addr >> 32) & 0xFFFFFFFF), |
1753 | (uint32_t)(addr & 0xFFFFFFFF), | 1753 | (uint32_t)(addr & 0xFFFFFFFF), |
@@ -1763,7 +1763,7 @@ ahd_dump_sglist(struct scb *scb) | |||
1763 | uint32_t len; | 1763 | uint32_t len; |
1764 | 1764 | ||
1765 | len = ahd_le32toh(sg_list[i].len); | 1765 | len = ahd_le32toh(sg_list[i].len); |
1766 | printf("sg[%d] - Addr 0x%x%x : Length %d%s\n", | 1766 | printk("sg[%d] - Addr 0x%x%x : Length %d%s\n", |
1767 | i, | 1767 | i, |
1768 | (len & AHD_SG_HIGH_ADDR_MASK) >> 24, | 1768 | (len & AHD_SG_HIGH_ADDR_MASK) >> 24, |
1769 | ahd_le32toh(sg_list[i].addr), | 1769 | ahd_le32toh(sg_list[i].addr), |
@@ -1802,7 +1802,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) | |||
1802 | ahd_update_modes(ahd); | 1802 | ahd_update_modes(ahd); |
1803 | #ifdef AHD_DEBUG | 1803 | #ifdef AHD_DEBUG |
1804 | if ((ahd_debug & AHD_SHOW_MISC) != 0) | 1804 | if ((ahd_debug & AHD_SHOW_MISC) != 0) |
1805 | printf("%s: Handle Seqint Called for code %d\n", | 1805 | printk("%s: Handle Seqint Called for code %d\n", |
1806 | ahd_name(ahd), seqintcode); | 1806 | ahd_name(ahd), seqintcode); |
1807 | #endif | 1807 | #endif |
1808 | switch (seqintcode) { | 1808 | switch (seqintcode) { |
@@ -1836,18 +1836,18 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) | |||
1836 | */ | 1836 | */ |
1837 | #ifdef AHD_DEBUG | 1837 | #ifdef AHD_DEBUG |
1838 | if ((ahd_debug & AHD_SHOW_RECOVERY) != 0) | 1838 | if ((ahd_debug & AHD_SHOW_RECOVERY) != 0) |
1839 | printf("%s: Assuming LQIPHASE_NLQ with " | 1839 | printk("%s: Assuming LQIPHASE_NLQ with " |
1840 | "P0 assertion\n", ahd_name(ahd)); | 1840 | "P0 assertion\n", ahd_name(ahd)); |
1841 | #endif | 1841 | #endif |
1842 | } | 1842 | } |
1843 | #ifdef AHD_DEBUG | 1843 | #ifdef AHD_DEBUG |
1844 | if ((ahd_debug & AHD_SHOW_RECOVERY) != 0) | 1844 | if ((ahd_debug & AHD_SHOW_RECOVERY) != 0) |
1845 | printf("%s: Entering NONPACK\n", ahd_name(ahd)); | 1845 | printk("%s: Entering NONPACK\n", ahd_name(ahd)); |
1846 | #endif | 1846 | #endif |
1847 | break; | 1847 | break; |
1848 | } | 1848 | } |
1849 | case INVALID_SEQINT: | 1849 | case INVALID_SEQINT: |
1850 | printf("%s: Invalid Sequencer interrupt occurred, " | 1850 | printk("%s: Invalid Sequencer interrupt occurred, " |
1851 | "resetting channel.\n", | 1851 | "resetting channel.\n", |
1852 | ahd_name(ahd)); | 1852 | ahd_name(ahd)); |
1853 | #ifdef AHD_DEBUG | 1853 | #ifdef AHD_DEBUG |
@@ -1866,8 +1866,8 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) | |||
1866 | if (scb != NULL) | 1866 | if (scb != NULL) |
1867 | ahd_print_path(ahd, scb); | 1867 | ahd_print_path(ahd, scb); |
1868 | else | 1868 | else |
1869 | printf("%s: ", ahd_name(ahd)); | 1869 | printk("%s: ", ahd_name(ahd)); |
1870 | printf("SCB %d Packetized Status Overrun", scbid); | 1870 | printk("SCB %d Packetized Status Overrun", scbid); |
1871 | ahd_dump_card_state(ahd); | 1871 | ahd_dump_card_state(ahd); |
1872 | ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE); | 1872 | ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE); |
1873 | break; | 1873 | break; |
@@ -1881,7 +1881,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) | |||
1881 | scb = ahd_lookup_scb(ahd, scbid); | 1881 | scb = ahd_lookup_scb(ahd, scbid); |
1882 | if (scb == NULL) { | 1882 | if (scb == NULL) { |
1883 | ahd_dump_card_state(ahd); | 1883 | ahd_dump_card_state(ahd); |
1884 | printf("CFG4ISTAT: Free SCB %d referenced", scbid); | 1884 | printk("CFG4ISTAT: Free SCB %d referenced", scbid); |
1885 | panic("For safety"); | 1885 | panic("For safety"); |
1886 | } | 1886 | } |
1887 | ahd_outq(ahd, HADDR, scb->sense_busaddr); | 1887 | ahd_outq(ahd, HADDR, scb->sense_busaddr); |
@@ -1896,7 +1896,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) | |||
1896 | u_int bus_phase; | 1896 | u_int bus_phase; |
1897 | 1897 | ||
1898 | bus_phase = ahd_inb(ahd, SCSISIGI) & PHASE_MASK; | 1898 | bus_phase = ahd_inb(ahd, SCSISIGI) & PHASE_MASK; |
1899 | printf("%s: ILLEGAL_PHASE 0x%x\n", | 1899 | printk("%s: ILLEGAL_PHASE 0x%x\n", |
1900 | ahd_name(ahd), bus_phase); | 1900 | ahd_name(ahd), bus_phase); |
1901 | 1901 | ||
1902 | switch (bus_phase) { | 1902 | switch (bus_phase) { |
@@ -1908,7 +1908,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) | |||
1908 | case P_STATUS: | 1908 | case P_STATUS: |
1909 | case P_MESGIN: | 1909 | case P_MESGIN: |
1910 | ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE); | 1910 | ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE); |
1911 | printf("%s: Issued Bus Reset.\n", ahd_name(ahd)); | 1911 | printk("%s: Issued Bus Reset.\n", ahd_name(ahd)); |
1912 | break; | 1912 | break; |
1913 | case P_COMMAND: | 1913 | case P_COMMAND: |
1914 | { | 1914 | { |
@@ -1933,7 +1933,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) | |||
1933 | scbid = ahd_get_scbptr(ahd); | 1933 | scbid = ahd_get_scbptr(ahd); |
1934 | scb = ahd_lookup_scb(ahd, scbid); | 1934 | scb = ahd_lookup_scb(ahd, scbid); |
1935 | if (scb == NULL) { | 1935 | if (scb == NULL) { |
1936 | printf("Invalid phase with no valid SCB. " | 1936 | printk("Invalid phase with no valid SCB. " |
1937 | "Resetting bus.\n"); | 1937 | "Resetting bus.\n"); |
1938 | ahd_reset_channel(ahd, 'A', | 1938 | ahd_reset_channel(ahd, 'A', |
1939 | /*Initiate Reset*/TRUE); | 1939 | /*Initiate Reset*/TRUE); |
@@ -1997,7 +1997,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) | |||
1997 | #ifdef AHD_DEBUG | 1997 | #ifdef AHD_DEBUG |
1998 | if ((ahd_debug & AHD_SHOW_RECOVERY) != 0) { | 1998 | if ((ahd_debug & AHD_SHOW_RECOVERY) != 0) { |
1999 | ahd_print_path(ahd, scb); | 1999 | ahd_print_path(ahd, scb); |
2000 | printf("Unexpected command phase from " | 2000 | printk("Unexpected command phase from " |
2001 | "packetized target\n"); | 2001 | "packetized target\n"); |
2002 | } | 2002 | } |
2003 | #endif | 2003 | #endif |
@@ -2013,7 +2013,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) | |||
2013 | 2013 | ||
2014 | #ifdef AHD_DEBUG | 2014 | #ifdef AHD_DEBUG |
2015 | if ((ahd_debug & AHD_SHOW_RECOVERY) != 0) { | 2015 | if ((ahd_debug & AHD_SHOW_RECOVERY) != 0) { |
2016 | printf("%s: CFG4OVERRUN mode = %x\n", ahd_name(ahd), | 2016 | printk("%s: CFG4OVERRUN mode = %x\n", ahd_name(ahd), |
2017 | ahd_inb(ahd, MODE_PTR)); | 2017 | ahd_inb(ahd, MODE_PTR)); |
2018 | } | 2018 | } |
2019 | #endif | 2019 | #endif |
@@ -2049,7 +2049,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) | |||
2049 | { | 2049 | { |
2050 | #ifdef AHD_DEBUG | 2050 | #ifdef AHD_DEBUG |
2051 | if ((ahd_debug & AHD_SHOW_RECOVERY) != 0) { | 2051 | if ((ahd_debug & AHD_SHOW_RECOVERY) != 0) { |
2052 | printf("%s: PDATA_REINIT - DFCNTRL = 0x%x " | 2052 | printk("%s: PDATA_REINIT - DFCNTRL = 0x%x " |
2053 | "SG_CACHE_SHADOW = 0x%x\n", | 2053 | "SG_CACHE_SHADOW = 0x%x\n", |
2054 | ahd_name(ahd), ahd_inb(ahd, DFCNTRL), | 2054 | ahd_name(ahd), ahd_inb(ahd, DFCNTRL), |
2055 | ahd_inb(ahd, SG_CACHE_SHADOW)); | 2055 | ahd_inb(ahd, SG_CACHE_SHADOW)); |
@@ -2082,7 +2082,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) | |||
2082 | bus_phase = ahd_inb(ahd, SCSISIGI) & PHASE_MASK; | 2082 | bus_phase = ahd_inb(ahd, SCSISIGI) & PHASE_MASK; |
2083 | if (bus_phase != P_MESGIN | 2083 | if (bus_phase != P_MESGIN |
2084 | && bus_phase != P_MESGOUT) { | 2084 | && bus_phase != P_MESGOUT) { |
2085 | printf("ahd_intr: HOST_MSG_LOOP bad " | 2085 | printk("ahd_intr: HOST_MSG_LOOP bad " |
2086 | "phase 0x%x\n", bus_phase); | 2086 | "phase 0x%x\n", bus_phase); |
2087 | /* | 2087 | /* |
2088 | * Probably transitioned to bus free before | 2088 | * Probably transitioned to bus free before |
@@ -2131,29 +2131,29 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) | |||
2131 | AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK); | 2131 | AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK); |
2132 | ahd_outb(ahd, SCSISEQ0, ahd_inb(ahd, SCSISEQ0) & ~ENSELO); | 2132 | ahd_outb(ahd, SCSISEQ0, ahd_inb(ahd, SCSISEQ0) & ~ENSELO); |
2133 | 2133 | ||
2134 | printf("%s:%c:%d: no active SCB for reconnecting " | 2134 | printk("%s:%c:%d: no active SCB for reconnecting " |
2135 | "target - issuing BUS DEVICE RESET\n", | 2135 | "target - issuing BUS DEVICE RESET\n", |
2136 | ahd_name(ahd), 'A', ahd_inb(ahd, SELID) >> 4); | 2136 | ahd_name(ahd), 'A', ahd_inb(ahd, SELID) >> 4); |
2137 | printf("SAVED_SCSIID == 0x%x, SAVED_LUN == 0x%x, " | 2137 | printk("SAVED_SCSIID == 0x%x, SAVED_LUN == 0x%x, " |
2138 | "REG0 == 0x%x ACCUM = 0x%x\n", | 2138 | "REG0 == 0x%x ACCUM = 0x%x\n", |
2139 | ahd_inb(ahd, SAVED_SCSIID), ahd_inb(ahd, SAVED_LUN), | 2139 | ahd_inb(ahd, SAVED_SCSIID), ahd_inb(ahd, SAVED_LUN), |
2140 | ahd_inw(ahd, REG0), ahd_inb(ahd, ACCUM)); | 2140 | ahd_inw(ahd, REG0), ahd_inb(ahd, ACCUM)); |
2141 | printf("SEQ_FLAGS == 0x%x, SCBPTR == 0x%x, BTT == 0x%x, " | 2141 | printk("SEQ_FLAGS == 0x%x, SCBPTR == 0x%x, BTT == 0x%x, " |
2142 | "SINDEX == 0x%x\n", | 2142 | "SINDEX == 0x%x\n", |
2143 | ahd_inb(ahd, SEQ_FLAGS), ahd_get_scbptr(ahd), | 2143 | ahd_inb(ahd, SEQ_FLAGS), ahd_get_scbptr(ahd), |
2144 | ahd_find_busy_tcl(ahd, | 2144 | ahd_find_busy_tcl(ahd, |
2145 | BUILD_TCL(ahd_inb(ahd, SAVED_SCSIID), | 2145 | BUILD_TCL(ahd_inb(ahd, SAVED_SCSIID), |
2146 | ahd_inb(ahd, SAVED_LUN))), | 2146 | ahd_inb(ahd, SAVED_LUN))), |
2147 | ahd_inw(ahd, SINDEX)); | 2147 | ahd_inw(ahd, SINDEX)); |
2148 | printf("SELID == 0x%x, SCB_SCSIID == 0x%x, SCB_LUN == 0x%x, " | 2148 | printk("SELID == 0x%x, SCB_SCSIID == 0x%x, SCB_LUN == 0x%x, " |
2149 | "SCB_CONTROL == 0x%x\n", | 2149 | "SCB_CONTROL == 0x%x\n", |
2150 | ahd_inb(ahd, SELID), ahd_inb_scbram(ahd, SCB_SCSIID), | 2150 | ahd_inb(ahd, SELID), ahd_inb_scbram(ahd, SCB_SCSIID), |
2151 | ahd_inb_scbram(ahd, SCB_LUN), | 2151 | ahd_inb_scbram(ahd, SCB_LUN), |
2152 | ahd_inb_scbram(ahd, SCB_CONTROL)); | 2152 | ahd_inb_scbram(ahd, SCB_CONTROL)); |
2153 | printf("SCSIBUS[0] == 0x%x, SCSISIGI == 0x%x\n", | 2153 | printk("SCSIBUS[0] == 0x%x, SCSISIGI == 0x%x\n", |
2154 | ahd_inb(ahd, SCSIBUS), ahd_inb(ahd, SCSISIGI)); | 2154 | ahd_inb(ahd, SCSIBUS), ahd_inb(ahd, SCSISIGI)); |
2155 | printf("SXFRCTL0 == 0x%x\n", ahd_inb(ahd, SXFRCTL0)); | 2155 | printk("SXFRCTL0 == 0x%x\n", ahd_inb(ahd, SXFRCTL0)); |
2156 | printf("SEQCTL0 == 0x%x\n", ahd_inb(ahd, SEQCTL0)); | 2156 | printk("SEQCTL0 == 0x%x\n", ahd_inb(ahd, SEQCTL0)); |
2157 | ahd_dump_card_state(ahd); | 2157 | ahd_dump_card_state(ahd); |
2158 | ahd->msgout_buf[0] = MSG_BUS_DEV_RESET; | 2158 | ahd->msgout_buf[0] = MSG_BUS_DEV_RESET; |
2159 | ahd->msgout_len = 1; | 2159 | ahd->msgout_len = 1; |
@@ -2181,7 +2181,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) | |||
2181 | u_int lastphase; | 2181 | u_int lastphase; |
2182 | 2182 | ||
2183 | lastphase = ahd_inb(ahd, LASTPHASE); | 2183 | lastphase = ahd_inb(ahd, LASTPHASE); |
2184 | printf("%s:%c:%d: unknown scsi bus phase %x, " | 2184 | printk("%s:%c:%d: unknown scsi bus phase %x, " |
2185 | "lastphase = 0x%x. Attempting to continue\n", | 2185 | "lastphase = 0x%x. Attempting to continue\n", |
2186 | ahd_name(ahd), 'A', | 2186 | ahd_name(ahd), 'A', |
2187 | SCSIID_TARGET(ahd, ahd_inb(ahd, SAVED_SCSIID)), | 2187 | SCSIID_TARGET(ahd, ahd_inb(ahd, SAVED_SCSIID)), |
@@ -2193,7 +2193,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) | |||
2193 | u_int lastphase; | 2193 | u_int lastphase; |
2194 | 2194 | ||
2195 | lastphase = ahd_inb(ahd, LASTPHASE); | 2195 | lastphase = ahd_inb(ahd, LASTPHASE); |
2196 | printf("%s:%c:%d: Missed busfree. " | 2196 | printk("%s:%c:%d: Missed busfree. " |
2197 | "Lastphase = 0x%x, Curphase = 0x%x\n", | 2197 | "Lastphase = 0x%x, Curphase = 0x%x\n", |
2198 | ahd_name(ahd), 'A', | 2198 | ahd_name(ahd), 'A', |
2199 | SCSIID_TARGET(ahd, ahd_inb(ahd, SAVED_SCSIID)), | 2199 | SCSIID_TARGET(ahd, ahd_inb(ahd, SAVED_SCSIID)), |
@@ -2223,11 +2223,11 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) | |||
2223 | lastphase = ahd_inb(ahd, LASTPHASE); | 2223 | lastphase = ahd_inb(ahd, LASTPHASE); |
2224 | if ((ahd_debug & AHD_SHOW_RECOVERY) != 0) { | 2224 | if ((ahd_debug & AHD_SHOW_RECOVERY) != 0) { |
2225 | ahd_print_path(ahd, scb); | 2225 | ahd_print_path(ahd, scb); |
2226 | printf("data overrun detected %s. Tag == 0x%x.\n", | 2226 | printk("data overrun detected %s. Tag == 0x%x.\n", |
2227 | ahd_lookup_phase_entry(lastphase)->phasemsg, | 2227 | ahd_lookup_phase_entry(lastphase)->phasemsg, |
2228 | SCB_GET_TAG(scb)); | 2228 | SCB_GET_TAG(scb)); |
2229 | ahd_print_path(ahd, scb); | 2229 | ahd_print_path(ahd, scb); |
2230 | printf("%s seen Data Phase. Length = %ld. " | 2230 | printk("%s seen Data Phase. Length = %ld. " |
2231 | "NumSGs = %d.\n", | 2231 | "NumSGs = %d.\n", |
2232 | ahd_inb(ahd, SEQ_FLAGS) & DPHASE | 2232 | ahd_inb(ahd, SEQ_FLAGS) & DPHASE |
2233 | ? "Have" : "Haven't", | 2233 | ? "Have" : "Haven't", |
@@ -2252,7 +2252,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) | |||
2252 | u_int scbid; | 2252 | u_int scbid; |
2253 | 2253 | ||
2254 | ahd_fetch_devinfo(ahd, &devinfo); | 2254 | ahd_fetch_devinfo(ahd, &devinfo); |
2255 | printf("%s:%c:%d:%d: Attempt to issue message failed\n", | 2255 | printk("%s:%c:%d:%d: Attempt to issue message failed\n", |
2256 | ahd_name(ahd), devinfo.channel, devinfo.target, | 2256 | ahd_name(ahd), devinfo.channel, devinfo.target, |
2257 | devinfo.lun); | 2257 | devinfo.lun); |
2258 | scbid = ahd_get_scbptr(ahd); | 2258 | scbid = ahd_get_scbptr(ahd); |
@@ -2285,7 +2285,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) | |||
2285 | cam_status error; | 2285 | cam_status error; |
2286 | 2286 | ||
2287 | ahd_print_path(ahd, scb); | 2287 | ahd_print_path(ahd, scb); |
2288 | printf("Task Management Func 0x%x Complete\n", | 2288 | printk("Task Management Func 0x%x Complete\n", |
2289 | scb->hscb->task_management); | 2289 | scb->hscb->task_management); |
2290 | lun = CAM_LUN_WILDCARD; | 2290 | lun = CAM_LUN_WILDCARD; |
2291 | tag = SCB_LIST_NULL; | 2291 | tag = SCB_LIST_NULL; |
@@ -2341,7 +2341,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) | |||
2341 | * the QINFIFO if it is still there. | 2341 | * the QINFIFO if it is still there. |
2342 | */ | 2342 | */ |
2343 | ahd_print_path(ahd, scb); | 2343 | ahd_print_path(ahd, scb); |
2344 | printf("SCB completes before TMF\n"); | 2344 | printk("SCB completes before TMF\n"); |
2345 | /* | 2345 | /* |
2346 | * Handle losing the race. Wait until any | 2346 | * Handle losing the race. Wait until any |
2347 | * current selection completes. We will then | 2347 | * current selection completes. We will then |
@@ -2366,7 +2366,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) | |||
2366 | case TRACEPOINT1: | 2366 | case TRACEPOINT1: |
2367 | case TRACEPOINT2: | 2367 | case TRACEPOINT2: |
2368 | case TRACEPOINT3: | 2368 | case TRACEPOINT3: |
2369 | printf("%s: Tracepoint %d\n", ahd_name(ahd), | 2369 | printk("%s: Tracepoint %d\n", ahd_name(ahd), |
2370 | seqintcode - TRACEPOINT0); | 2370 | seqintcode - TRACEPOINT0); |
2371 | break; | 2371 | break; |
2372 | case NO_SEQINT: | 2372 | case NO_SEQINT: |
@@ -2375,7 +2375,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) | |||
2375 | ahd_handle_hwerrint(ahd); | 2375 | ahd_handle_hwerrint(ahd); |
2376 | break; | 2376 | break; |
2377 | default: | 2377 | default: |
2378 | printf("%s: Unexpected SEQINTCODE %d\n", ahd_name(ahd), | 2378 | printk("%s: Unexpected SEQINTCODE %d\n", ahd_name(ahd), |
2379 | seqintcode); | 2379 | seqintcode); |
2380 | break; | 2380 | break; |
2381 | } | 2381 | } |
@@ -2440,7 +2440,7 @@ ahd_handle_scsiint(struct ahd_softc *ahd, u_int intstat) | |||
2440 | u_int now_lvd; | 2440 | u_int now_lvd; |
2441 | 2441 | ||
2442 | now_lvd = ahd_inb(ahd, SBLKCTL) & ENAB40; | 2442 | now_lvd = ahd_inb(ahd, SBLKCTL) & ENAB40; |
2443 | printf("%s: Transceiver State Has Changed to %s mode\n", | 2443 | printk("%s: Transceiver State Has Changed to %s mode\n", |
2444 | ahd_name(ahd), now_lvd ? "LVD" : "SE"); | 2444 | ahd_name(ahd), now_lvd ? "LVD" : "SE"); |
2445 | ahd_outb(ahd, CLRSINT0, CLRIOERR); | 2445 | ahd_outb(ahd, CLRSINT0, CLRIOERR); |
2446 | /* | 2446 | /* |
@@ -2452,12 +2452,12 @@ ahd_handle_scsiint(struct ahd_softc *ahd, u_int intstat) | |||
2452 | ahd_unpause(ahd); | 2452 | ahd_unpause(ahd); |
2453 | } else if ((status0 & OVERRUN) != 0) { | 2453 | } else if ((status0 & OVERRUN) != 0) { |
2454 | 2454 | ||
2455 | printf("%s: SCSI offset overrun detected. Resetting bus.\n", | 2455 | printk("%s: SCSI offset overrun detected. Resetting bus.\n", |
2456 | ahd_name(ahd)); | 2456 | ahd_name(ahd)); |
2457 | ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE); | 2457 | ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE); |
2458 | } else if ((status & SCSIRSTI) != 0) { | 2458 | } else if ((status & SCSIRSTI) != 0) { |
2459 | 2459 | ||
2460 | printf("%s: Someone reset channel A\n", ahd_name(ahd)); | 2460 | printk("%s: Someone reset channel A\n", ahd_name(ahd)); |
2461 | ahd_reset_channel(ahd, 'A', /*Initiate Reset*/FALSE); | 2461 | ahd_reset_channel(ahd, 'A', /*Initiate Reset*/FALSE); |
2462 | } else if ((status & SCSIPERR) != 0) { | 2462 | } else if ((status & SCSIPERR) != 0) { |
2463 | 2463 | ||
@@ -2467,7 +2467,7 @@ ahd_handle_scsiint(struct ahd_softc *ahd, u_int intstat) | |||
2467 | ahd_handle_transmission_error(ahd); | 2467 | ahd_handle_transmission_error(ahd); |
2468 | } else if (lqostat0 != 0) { | 2468 | } else if (lqostat0 != 0) { |
2469 | 2469 | ||
2470 | printf("%s: lqostat0 == 0x%x!\n", ahd_name(ahd), lqostat0); | 2470 | printk("%s: lqostat0 == 0x%x!\n", ahd_name(ahd), lqostat0); |
2471 | ahd_outb(ahd, CLRLQOINT0, lqostat0); | 2471 | ahd_outb(ahd, CLRLQOINT0, lqostat0); |
2472 | if ((ahd->bugs & AHD_CLRLQO_AUTOCLR_BUG) != 0) | 2472 | if ((ahd->bugs & AHD_CLRLQO_AUTOCLR_BUG) != 0) |
2473 | ahd_outb(ahd, CLRLQOINT1, 0); | 2473 | ahd_outb(ahd, CLRLQOINT1, 0); |
@@ -2497,7 +2497,7 @@ ahd_handle_scsiint(struct ahd_softc *ahd, u_int intstat) | |||
2497 | scbid = ahd_inw(ahd, WAITING_TID_HEAD); | 2497 | scbid = ahd_inw(ahd, WAITING_TID_HEAD); |
2498 | scb = ahd_lookup_scb(ahd, scbid); | 2498 | scb = ahd_lookup_scb(ahd, scbid); |
2499 | if (scb == NULL) { | 2499 | if (scb == NULL) { |
2500 | printf("%s: ahd_intr - referenced scb not " | 2500 | printk("%s: ahd_intr - referenced scb not " |
2501 | "valid during SELTO scb(0x%x)\n", | 2501 | "valid during SELTO scb(0x%x)\n", |
2502 | ahd_name(ahd), scbid); | 2502 | ahd_name(ahd), scbid); |
2503 | ahd_dump_card_state(ahd); | 2503 | ahd_dump_card_state(ahd); |
@@ -2506,7 +2506,7 @@ ahd_handle_scsiint(struct ahd_softc *ahd, u_int intstat) | |||
2506 | #ifdef AHD_DEBUG | 2506 | #ifdef AHD_DEBUG |
2507 | if ((ahd_debug & AHD_SHOW_SELTO) != 0) { | 2507 | if ((ahd_debug & AHD_SHOW_SELTO) != 0) { |
2508 | ahd_print_path(ahd, scb); | 2508 | ahd_print_path(ahd, scb); |
2509 | printf("Saw Selection Timeout for SCB 0x%x\n", | 2509 | printk("Saw Selection Timeout for SCB 0x%x\n", |
2510 | scbid); | 2510 | scbid); |
2511 | } | 2511 | } |
2512 | #endif | 2512 | #endif |
@@ -2534,7 +2534,7 @@ ahd_handle_scsiint(struct ahd_softc *ahd, u_int intstat) | |||
2534 | ahd_iocell_first_selection(ahd); | 2534 | ahd_iocell_first_selection(ahd); |
2535 | ahd_unpause(ahd); | 2535 | ahd_unpause(ahd); |
2536 | } else if (status3 != 0) { | 2536 | } else if (status3 != 0) { |
2537 | printf("%s: SCSI Cell parity error SSTAT3 == 0x%x\n", | 2537 | printk("%s: SCSI Cell parity error SSTAT3 == 0x%x\n", |
2538 | ahd_name(ahd), status3); | 2538 | ahd_name(ahd), status3); |
2539 | ahd_outb(ahd, CLRSINT3, status3); | 2539 | ahd_outb(ahd, CLRSINT3, status3); |
2540 | } else if ((lqistat1 & (LQIPHASE_LQ|LQIPHASE_NLQ)) != 0) { | 2540 | } else if ((lqistat1 & (LQIPHASE_LQ|LQIPHASE_NLQ)) != 0) { |
@@ -2587,7 +2587,7 @@ ahd_handle_scsiint(struct ahd_softc *ahd, u_int intstat) | |||
2587 | scbid = ahd_get_scbptr(ahd); | 2587 | scbid = ahd_get_scbptr(ahd); |
2588 | scb = ahd_lookup_scb(ahd, scbid); | 2588 | scb = ahd_lookup_scb(ahd, scbid); |
2589 | if (scb == NULL) { | 2589 | if (scb == NULL) { |
2590 | printf("%s: Invalid SCB %d in DFF%d " | 2590 | printk("%s: Invalid SCB %d in DFF%d " |
2591 | "during unexpected busfree\n", | 2591 | "during unexpected busfree\n", |
2592 | ahd_name(ahd), scbid, mode); | 2592 | ahd_name(ahd), scbid, mode); |
2593 | packetized = 0; | 2593 | packetized = 0; |
@@ -2620,7 +2620,7 @@ ahd_handle_scsiint(struct ahd_softc *ahd, u_int intstat) | |||
2620 | 2620 | ||
2621 | #ifdef AHD_DEBUG | 2621 | #ifdef AHD_DEBUG |
2622 | if ((ahd_debug & AHD_SHOW_MISC) != 0) | 2622 | if ((ahd_debug & AHD_SHOW_MISC) != 0) |
2623 | printf("Saw Busfree. Busfreetime = 0x%x.\n", | 2623 | printk("Saw Busfree. Busfreetime = 0x%x.\n", |
2624 | busfreetime); | 2624 | busfreetime); |
2625 | #endif | 2625 | #endif |
2626 | /* | 2626 | /* |
@@ -2661,7 +2661,7 @@ ahd_handle_scsiint(struct ahd_softc *ahd, u_int intstat) | |||
2661 | ahd_unpause(ahd); | 2661 | ahd_unpause(ahd); |
2662 | } | 2662 | } |
2663 | } else { | 2663 | } else { |
2664 | printf("%s: Missing case in ahd_handle_scsiint. status = %x\n", | 2664 | printk("%s: Missing case in ahd_handle_scsiint. status = %x\n", |
2665 | ahd_name(ahd), status); | 2665 | ahd_name(ahd), status); |
2666 | ahd_dump_card_state(ahd); | 2666 | ahd_dump_card_state(ahd); |
2667 | ahd_clear_intstat(ahd); | 2667 | ahd_clear_intstat(ahd); |
@@ -2697,7 +2697,7 @@ ahd_handle_transmission_error(struct ahd_softc *ahd) | |||
2697 | || (lqistate == 0x29)) { | 2697 | || (lqistate == 0x29)) { |
2698 | #ifdef AHD_DEBUG | 2698 | #ifdef AHD_DEBUG |
2699 | if ((ahd_debug & AHD_SHOW_RECOVERY) != 0) { | 2699 | if ((ahd_debug & AHD_SHOW_RECOVERY) != 0) { |
2700 | printf("%s: NLQCRC found via LQISTATE\n", | 2700 | printk("%s: NLQCRC found via LQISTATE\n", |
2701 | ahd_name(ahd)); | 2701 | ahd_name(ahd)); |
2702 | } | 2702 | } |
2703 | #endif | 2703 | #endif |
@@ -2729,18 +2729,18 @@ ahd_handle_transmission_error(struct ahd_softc *ahd) | |||
2729 | 2729 | ||
2730 | cur_col = 0; | 2730 | cur_col = 0; |
2731 | if (silent == FALSE) { | 2731 | if (silent == FALSE) { |
2732 | printf("%s: Transmission error detected\n", ahd_name(ahd)); | 2732 | printk("%s: Transmission error detected\n", ahd_name(ahd)); |
2733 | ahd_lqistat1_print(lqistat1, &cur_col, 50); | 2733 | ahd_lqistat1_print(lqistat1, &cur_col, 50); |
2734 | ahd_lastphase_print(lastphase, &cur_col, 50); | 2734 | ahd_lastphase_print(lastphase, &cur_col, 50); |
2735 | ahd_scsisigi_print(curphase, &cur_col, 50); | 2735 | ahd_scsisigi_print(curphase, &cur_col, 50); |
2736 | ahd_perrdiag_print(perrdiag, &cur_col, 50); | 2736 | ahd_perrdiag_print(perrdiag, &cur_col, 50); |
2737 | printf("\n"); | 2737 | printk("\n"); |
2738 | ahd_dump_card_state(ahd); | 2738 | ahd_dump_card_state(ahd); |
2739 | } | 2739 | } |
2740 | 2740 | ||
2741 | if ((lqistat1 & (LQIOVERI_LQ|LQIOVERI_NLQ)) != 0) { | 2741 | if ((lqistat1 & (LQIOVERI_LQ|LQIOVERI_NLQ)) != 0) { |
2742 | if (silent == FALSE) { | 2742 | if (silent == FALSE) { |
2743 | printf("%s: Gross protocol error during incoming " | 2743 | printk("%s: Gross protocol error during incoming " |
2744 | "packet. lqistat1 == 0x%x. Resetting bus.\n", | 2744 | "packet. lqistat1 == 0x%x. Resetting bus.\n", |
2745 | ahd_name(ahd), lqistat1); | 2745 | ahd_name(ahd), lqistat1); |
2746 | } | 2746 | } |
@@ -2769,7 +2769,7 @@ ahd_handle_transmission_error(struct ahd_softc *ahd) | |||
2769 | * (SPI4R09 10.7.3.3.3) | 2769 | * (SPI4R09 10.7.3.3.3) |
2770 | */ | 2770 | */ |
2771 | ahd_outb(ahd, LQCTL2, LQIRETRY); | 2771 | ahd_outb(ahd, LQCTL2, LQIRETRY); |
2772 | printf("LQIRetry for LQICRCI_LQ to release ACK\n"); | 2772 | printk("LQIRetry for LQICRCI_LQ to release ACK\n"); |
2773 | } else if ((lqistat1 & LQICRCI_NLQ) != 0) { | 2773 | } else if ((lqistat1 & LQICRCI_NLQ) != 0) { |
2774 | /* | 2774 | /* |
2775 | * We detected a CRC error in a NON-LQ packet. | 2775 | * We detected a CRC error in a NON-LQ packet. |
@@ -2817,22 +2817,22 @@ ahd_handle_transmission_error(struct ahd_softc *ahd) | |||
2817 | * Busfree detection is enabled. | 2817 | * Busfree detection is enabled. |
2818 | */ | 2818 | */ |
2819 | if (silent == FALSE) | 2819 | if (silent == FALSE) |
2820 | printf("LQICRC_NLQ\n"); | 2820 | printk("LQICRC_NLQ\n"); |
2821 | if (scb == NULL) { | 2821 | if (scb == NULL) { |
2822 | printf("%s: No SCB valid for LQICRC_NLQ. " | 2822 | printk("%s: No SCB valid for LQICRC_NLQ. " |
2823 | "Resetting bus\n", ahd_name(ahd)); | 2823 | "Resetting bus\n", ahd_name(ahd)); |
2824 | ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE); | 2824 | ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE); |
2825 | return; | 2825 | return; |
2826 | } | 2826 | } |
2827 | } else if ((lqistat1 & LQIBADLQI) != 0) { | 2827 | } else if ((lqistat1 & LQIBADLQI) != 0) { |
2828 | printf("Need to handle BADLQI!\n"); | 2828 | printk("Need to handle BADLQI!\n"); |
2829 | ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE); | 2829 | ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE); |
2830 | return; | 2830 | return; |
2831 | } else if ((perrdiag & (PARITYERR|PREVPHASE)) == PARITYERR) { | 2831 | } else if ((perrdiag & (PARITYERR|PREVPHASE)) == PARITYERR) { |
2832 | if ((curphase & ~P_DATAIN_DT) != 0) { | 2832 | if ((curphase & ~P_DATAIN_DT) != 0) { |
2833 | /* Ack the byte. So we can continue. */ | 2833 | /* Ack the byte. So we can continue. */ |
2834 | if (silent == FALSE) | 2834 | if (silent == FALSE) |
2835 | printf("Acking %s to clear perror\n", | 2835 | printk("Acking %s to clear perror\n", |
2836 | ahd_lookup_phase_entry(curphase)->phasemsg); | 2836 | ahd_lookup_phase_entry(curphase)->phasemsg); |
2837 | ahd_inb(ahd, SCSIDAT); | 2837 | ahd_inb(ahd, SCSIDAT); |
2838 | } | 2838 | } |
@@ -2877,10 +2877,10 @@ ahd_handle_lqiphase_error(struct ahd_softc *ahd, u_int lqistat1) | |||
2877 | if ((ahd_inb(ahd, SCSISIGO) & ATNO) != 0 | 2877 | if ((ahd_inb(ahd, SCSISIGO) & ATNO) != 0 |
2878 | && (ahd_inb(ahd, MDFFSTAT) & DLZERO) != 0) { | 2878 | && (ahd_inb(ahd, MDFFSTAT) & DLZERO) != 0) { |
2879 | if ((lqistat1 & LQIPHASE_LQ) != 0) { | 2879 | if ((lqistat1 & LQIPHASE_LQ) != 0) { |
2880 | printf("LQIRETRY for LQIPHASE_LQ\n"); | 2880 | printk("LQIRETRY for LQIPHASE_LQ\n"); |
2881 | ahd_outb(ahd, LQCTL2, LQIRETRY); | 2881 | ahd_outb(ahd, LQCTL2, LQIRETRY); |
2882 | } else if ((lqistat1 & LQIPHASE_NLQ) != 0) { | 2882 | } else if ((lqistat1 & LQIPHASE_NLQ) != 0) { |
2883 | printf("LQIRETRY for LQIPHASE_NLQ\n"); | 2883 | printk("LQIRETRY for LQIPHASE_NLQ\n"); |
2884 | ahd_outb(ahd, LQCTL2, LQIRETRY); | 2884 | ahd_outb(ahd, LQCTL2, LQIRETRY); |
2885 | } else | 2885 | } else |
2886 | panic("ahd_handle_lqiphase_error: No phase errors\n"); | 2886 | panic("ahd_handle_lqiphase_error: No phase errors\n"); |
@@ -2888,7 +2888,7 @@ ahd_handle_lqiphase_error(struct ahd_softc *ahd, u_int lqistat1) | |||
2888 | ahd_outb(ahd, CLRINT, CLRSCSIINT); | 2888 | ahd_outb(ahd, CLRINT, CLRSCSIINT); |
2889 | ahd_unpause(ahd); | 2889 | ahd_unpause(ahd); |
2890 | } else { | 2890 | } else { |
2891 | printf("Reseting Channel for LQI Phase error\n"); | 2891 | printk("Reseting Channel for LQI Phase error\n"); |
2892 | ahd_dump_card_state(ahd); | 2892 | ahd_dump_card_state(ahd); |
2893 | ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE); | 2893 | ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE); |
2894 | } | 2894 | } |
@@ -2976,7 +2976,7 @@ ahd_handle_pkt_busfree(struct ahd_softc *ahd, u_int busfreetime) | |||
2976 | if (scb->crc_retry_count < AHD_MAX_LQ_CRC_ERRORS) { | 2976 | if (scb->crc_retry_count < AHD_MAX_LQ_CRC_ERRORS) { |
2977 | if (SCB_IS_SILENT(scb) == FALSE) { | 2977 | if (SCB_IS_SILENT(scb) == FALSE) { |
2978 | ahd_print_path(ahd, scb); | 2978 | ahd_print_path(ahd, scb); |
2979 | printf("Probable outgoing LQ CRC error. " | 2979 | printk("Probable outgoing LQ CRC error. " |
2980 | "Retrying command\n"); | 2980 | "Retrying command\n"); |
2981 | } | 2981 | } |
2982 | scb->crc_retry_count++; | 2982 | scb->crc_retry_count++; |
@@ -2998,7 +2998,7 @@ ahd_handle_pkt_busfree(struct ahd_softc *ahd, u_int busfreetime) | |||
2998 | ahd_outb(ahd, CLRSINT1, CLRSCSIPERR|CLRBUSFREE); | 2998 | ahd_outb(ahd, CLRSINT1, CLRSCSIPERR|CLRBUSFREE); |
2999 | #ifdef AHD_DEBUG | 2999 | #ifdef AHD_DEBUG |
3000 | if ((ahd_debug & AHD_SHOW_MASKED_ERRORS) != 0) | 3000 | if ((ahd_debug & AHD_SHOW_MASKED_ERRORS) != 0) |
3001 | printf("%s: Parity on last REQ detected " | 3001 | printk("%s: Parity on last REQ detected " |
3002 | "during busfree phase.\n", | 3002 | "during busfree phase.\n", |
3003 | ahd_name(ahd)); | 3003 | ahd_name(ahd)); |
3004 | #endif | 3004 | #endif |
@@ -3012,7 +3012,7 @@ ahd_handle_pkt_busfree(struct ahd_softc *ahd, u_int busfreetime) | |||
3012 | scbid = ahd_get_scbptr(ahd); | 3012 | scbid = ahd_get_scbptr(ahd); |
3013 | scb = ahd_lookup_scb(ahd, scbid); | 3013 | scb = ahd_lookup_scb(ahd, scbid); |
3014 | ahd_print_path(ahd, scb); | 3014 | ahd_print_path(ahd, scb); |
3015 | printf("Unexpected PKT busfree condition\n"); | 3015 | printk("Unexpected PKT busfree condition\n"); |
3016 | ahd_dump_card_state(ahd); | 3016 | ahd_dump_card_state(ahd); |
3017 | ahd_abort_scbs(ahd, SCB_GET_TARGET(ahd, scb), 'A', | 3017 | ahd_abort_scbs(ahd, SCB_GET_TARGET(ahd, scb), 'A', |
3018 | SCB_GET_LUN(scb), SCB_GET_TAG(scb), | 3018 | SCB_GET_LUN(scb), SCB_GET_TAG(scb), |
@@ -3021,7 +3021,7 @@ ahd_handle_pkt_busfree(struct ahd_softc *ahd, u_int busfreetime) | |||
3021 | /* Return restarting the sequencer. */ | 3021 | /* Return restarting the sequencer. */ |
3022 | return (1); | 3022 | return (1); |
3023 | } | 3023 | } |
3024 | printf("%s: Unexpected PKT busfree condition\n", ahd_name(ahd)); | 3024 | printk("%s: Unexpected PKT busfree condition\n", ahd_name(ahd)); |
3025 | ahd_dump_card_state(ahd); | 3025 | ahd_dump_card_state(ahd); |
3026 | /* Restart the sequencer. */ | 3026 | /* Restart the sequencer. */ |
3027 | return (1); | 3027 | return (1); |
@@ -3076,14 +3076,14 @@ ahd_handle_nonpkt_busfree(struct ahd_softc *ahd) | |||
3076 | 3076 | ||
3077 | if (scb == NULL) { | 3077 | if (scb == NULL) { |
3078 | ahd_print_devinfo(ahd, &devinfo); | 3078 | ahd_print_devinfo(ahd, &devinfo); |
3079 | printf("Abort for unidentified " | 3079 | printk("Abort for unidentified " |
3080 | "connection completed.\n"); | 3080 | "connection completed.\n"); |
3081 | /* restart the sequencer. */ | 3081 | /* restart the sequencer. */ |
3082 | return (1); | 3082 | return (1); |
3083 | } | 3083 | } |
3084 | sent_msg = ahd->msgout_buf[ahd->msgout_index - 1]; | 3084 | sent_msg = ahd->msgout_buf[ahd->msgout_index - 1]; |
3085 | ahd_print_path(ahd, scb); | 3085 | ahd_print_path(ahd, scb); |
3086 | printf("SCB %d - Abort%s Completed.\n", | 3086 | printk("SCB %d - Abort%s Completed.\n", |
3087 | SCB_GET_TAG(scb), | 3087 | SCB_GET_TAG(scb), |
3088 | sent_msg == MSG_ABORT_TAG ? "" : " Tag"); | 3088 | sent_msg == MSG_ABORT_TAG ? "" : " Tag"); |
3089 | 3089 | ||
@@ -3109,7 +3109,7 @@ ahd_handle_nonpkt_busfree(struct ahd_softc *ahd) | |||
3109 | found = ahd_abort_scbs(ahd, target, 'A', saved_lun, | 3109 | found = ahd_abort_scbs(ahd, target, 'A', saved_lun, |
3110 | tag, ROLE_INITIATOR, | 3110 | tag, ROLE_INITIATOR, |
3111 | CAM_REQ_ABORTED); | 3111 | CAM_REQ_ABORTED); |
3112 | printf("found == 0x%x\n", found); | 3112 | printk("found == 0x%x\n", found); |
3113 | printerror = 0; | 3113 | printerror = 0; |
3114 | } else if (ahd_sent_msg(ahd, AHDMSG_1B, | 3114 | } else if (ahd_sent_msg(ahd, AHDMSG_1B, |
3115 | MSG_BUS_DEV_RESET, TRUE)) { | 3115 | MSG_BUS_DEV_RESET, TRUE)) { |
@@ -3147,7 +3147,7 @@ ahd_handle_nonpkt_busfree(struct ahd_softc *ahd) | |||
3147 | */ | 3147 | */ |
3148 | #ifdef AHD_DEBUG | 3148 | #ifdef AHD_DEBUG |
3149 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) | 3149 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) |
3150 | printf("PPR negotiation rejected busfree.\n"); | 3150 | printk("PPR negotiation rejected busfree.\n"); |
3151 | #endif | 3151 | #endif |
3152 | tinfo = ahd_fetch_transinfo(ahd, devinfo.channel, | 3152 | tinfo = ahd_fetch_transinfo(ahd, devinfo.channel, |
3153 | devinfo.our_scsiid, | 3153 | devinfo.our_scsiid, |
@@ -3191,7 +3191,7 @@ ahd_handle_nonpkt_busfree(struct ahd_softc *ahd) | |||
3191 | */ | 3191 | */ |
3192 | #ifdef AHD_DEBUG | 3192 | #ifdef AHD_DEBUG |
3193 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) | 3193 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) |
3194 | printf("WDTR negotiation rejected busfree.\n"); | 3194 | printk("WDTR negotiation rejected busfree.\n"); |
3195 | #endif | 3195 | #endif |
3196 | ahd_set_width(ahd, &devinfo, | 3196 | ahd_set_width(ahd, &devinfo, |
3197 | MSG_EXT_WDTR_BUS_8_BIT, | 3197 | MSG_EXT_WDTR_BUS_8_BIT, |
@@ -3216,7 +3216,7 @@ ahd_handle_nonpkt_busfree(struct ahd_softc *ahd) | |||
3216 | */ | 3216 | */ |
3217 | #ifdef AHD_DEBUG | 3217 | #ifdef AHD_DEBUG |
3218 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) | 3218 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) |
3219 | printf("SDTR negotiation rejected busfree.\n"); | 3219 | printk("SDTR negotiation rejected busfree.\n"); |
3220 | #endif | 3220 | #endif |
3221 | ahd_set_syncrate(ahd, &devinfo, | 3221 | ahd_set_syncrate(ahd, &devinfo, |
3222 | /*period*/0, /*offset*/0, | 3222 | /*period*/0, /*offset*/0, |
@@ -3240,7 +3240,7 @@ ahd_handle_nonpkt_busfree(struct ahd_softc *ahd) | |||
3240 | 3240 | ||
3241 | #ifdef AHD_DEBUG | 3241 | #ifdef AHD_DEBUG |
3242 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) | 3242 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) |
3243 | printf("Expected IDE Busfree\n"); | 3243 | printk("Expected IDE Busfree\n"); |
3244 | #endif | 3244 | #endif |
3245 | printerror = 0; | 3245 | printerror = 0; |
3246 | } else if ((ahd->msg_flags & MSG_FLAG_EXPECT_QASREJ_BUSFREE) | 3246 | } else if ((ahd->msg_flags & MSG_FLAG_EXPECT_QASREJ_BUSFREE) |
@@ -3249,7 +3249,7 @@ ahd_handle_nonpkt_busfree(struct ahd_softc *ahd) | |||
3249 | 3249 | ||
3250 | #ifdef AHD_DEBUG | 3250 | #ifdef AHD_DEBUG |
3251 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) | 3251 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) |
3252 | printf("Expected QAS Reject Busfree\n"); | 3252 | printk("Expected QAS Reject Busfree\n"); |
3253 | #endif | 3253 | #endif |
3254 | printerror = 0; | 3254 | printerror = 0; |
3255 | } | 3255 | } |
@@ -3275,7 +3275,7 @@ ahd_handle_nonpkt_busfree(struct ahd_softc *ahd) | |||
3275 | } else { | 3275 | } else { |
3276 | #ifdef AHD_DEBUG | 3276 | #ifdef AHD_DEBUG |
3277 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) | 3277 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) |
3278 | printf("PPR Negotiation Busfree.\n"); | 3278 | printk("PPR Negotiation Busfree.\n"); |
3279 | #endif | 3279 | #endif |
3280 | ahd_done(ahd, scb); | 3280 | ahd_done(ahd, scb); |
3281 | } | 3281 | } |
@@ -3302,9 +3302,9 @@ ahd_handle_nonpkt_busfree(struct ahd_softc *ahd) | |||
3302 | * We had not fully identified this connection, | 3302 | * We had not fully identified this connection, |
3303 | * so we cannot abort anything. | 3303 | * so we cannot abort anything. |
3304 | */ | 3304 | */ |
3305 | printf("%s: ", ahd_name(ahd)); | 3305 | printk("%s: ", ahd_name(ahd)); |
3306 | } | 3306 | } |
3307 | printf("Unexpected busfree %s, %d SCBs aborted, " | 3307 | printk("Unexpected busfree %s, %d SCBs aborted, " |
3308 | "PRGMCNT == 0x%x\n", | 3308 | "PRGMCNT == 0x%x\n", |
3309 | ahd_lookup_phase_entry(lastphase)->phasemsg, | 3309 | ahd_lookup_phase_entry(lastphase)->phasemsg, |
3310 | aborted, | 3310 | aborted, |
@@ -3342,7 +3342,7 @@ ahd_handle_proto_violation(struct ahd_softc *ahd) | |||
3342 | * to match. | 3342 | * to match. |
3343 | */ | 3343 | */ |
3344 | ahd_print_devinfo(ahd, &devinfo); | 3344 | ahd_print_devinfo(ahd, &devinfo); |
3345 | printf("Target did not send an IDENTIFY message. " | 3345 | printk("Target did not send an IDENTIFY message. " |
3346 | "LASTPHASE = 0x%x.\n", lastphase); | 3346 | "LASTPHASE = 0x%x.\n", lastphase); |
3347 | scb = NULL; | 3347 | scb = NULL; |
3348 | } else if (scb == NULL) { | 3348 | } else if (scb == NULL) { |
@@ -3351,13 +3351,13 @@ ahd_handle_proto_violation(struct ahd_softc *ahd) | |||
3351 | * transaction. Print an error and reset the bus. | 3351 | * transaction. Print an error and reset the bus. |
3352 | */ | 3352 | */ |
3353 | ahd_print_devinfo(ahd, &devinfo); | 3353 | ahd_print_devinfo(ahd, &devinfo); |
3354 | printf("No SCB found during protocol violation\n"); | 3354 | printk("No SCB found during protocol violation\n"); |
3355 | goto proto_violation_reset; | 3355 | goto proto_violation_reset; |
3356 | } else { | 3356 | } else { |
3357 | ahd_set_transaction_status(scb, CAM_SEQUENCE_FAIL); | 3357 | ahd_set_transaction_status(scb, CAM_SEQUENCE_FAIL); |
3358 | if ((seq_flags & NO_CDB_SENT) != 0) { | 3358 | if ((seq_flags & NO_CDB_SENT) != 0) { |
3359 | ahd_print_path(ahd, scb); | 3359 | ahd_print_path(ahd, scb); |
3360 | printf("No or incomplete CDB sent to device.\n"); | 3360 | printk("No or incomplete CDB sent to device.\n"); |
3361 | } else if ((ahd_inb_scbram(ahd, SCB_CONTROL) | 3361 | } else if ((ahd_inb_scbram(ahd, SCB_CONTROL) |
3362 | & STATUS_RCVD) == 0) { | 3362 | & STATUS_RCVD) == 0) { |
3363 | /* | 3363 | /* |
@@ -3368,10 +3368,10 @@ ahd_handle_proto_violation(struct ahd_softc *ahd) | |||
3368 | * message. | 3368 | * message. |
3369 | */ | 3369 | */ |
3370 | ahd_print_path(ahd, scb); | 3370 | ahd_print_path(ahd, scb); |
3371 | printf("Completed command without status.\n"); | 3371 | printk("Completed command without status.\n"); |
3372 | } else { | 3372 | } else { |
3373 | ahd_print_path(ahd, scb); | 3373 | ahd_print_path(ahd, scb); |
3374 | printf("Unknown protocol violation.\n"); | 3374 | printk("Unknown protocol violation.\n"); |
3375 | ahd_dump_card_state(ahd); | 3375 | ahd_dump_card_state(ahd); |
3376 | } | 3376 | } |
3377 | } | 3377 | } |
@@ -3385,7 +3385,7 @@ proto_violation_reset: | |||
3385 | * it away with a bus reset. | 3385 | * it away with a bus reset. |
3386 | */ | 3386 | */ |
3387 | found = ahd_reset_channel(ahd, 'A', TRUE); | 3387 | found = ahd_reset_channel(ahd, 'A', TRUE); |
3388 | printf("%s: Issued Channel %c Bus Reset. " | 3388 | printk("%s: Issued Channel %c Bus Reset. " |
3389 | "%d SCBs aborted\n", ahd_name(ahd), 'A', found); | 3389 | "%d SCBs aborted\n", ahd_name(ahd), 'A', found); |
3390 | } else { | 3390 | } else { |
3391 | /* | 3391 | /* |
@@ -3407,7 +3407,7 @@ proto_violation_reset: | |||
3407 | ahd_print_path(ahd, scb); | 3407 | ahd_print_path(ahd, scb); |
3408 | scb->flags |= SCB_ABORT; | 3408 | scb->flags |= SCB_ABORT; |
3409 | } | 3409 | } |
3410 | printf("Protocol violation %s. Attempting to abort.\n", | 3410 | printk("Protocol violation %s. Attempting to abort.\n", |
3411 | ahd_lookup_phase_entry(curphase)->phasemsg); | 3411 | ahd_lookup_phase_entry(curphase)->phasemsg); |
3412 | } | 3412 | } |
3413 | } | 3413 | } |
@@ -3425,7 +3425,7 @@ ahd_force_renegotiation(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) | |||
3425 | #ifdef AHD_DEBUG | 3425 | #ifdef AHD_DEBUG |
3426 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) { | 3426 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) { |
3427 | ahd_print_devinfo(ahd, devinfo); | 3427 | ahd_print_devinfo(ahd, devinfo); |
3428 | printf("Forcing renegotiation\n"); | 3428 | printk("Forcing renegotiation\n"); |
3429 | } | 3429 | } |
3430 | #endif | 3430 | #endif |
3431 | targ_info = ahd_fetch_transinfo(ahd, | 3431 | targ_info = ahd_fetch_transinfo(ahd, |
@@ -3486,7 +3486,7 @@ ahd_clear_critical_section(struct ahd_softc *ahd) | |||
3486 | break; | 3486 | break; |
3487 | 3487 | ||
3488 | if (steps > AHD_MAX_STEPS) { | 3488 | if (steps > AHD_MAX_STEPS) { |
3489 | printf("%s: Infinite loop in critical section\n" | 3489 | printk("%s: Infinite loop in critical section\n" |
3490 | "%s: First Instruction 0x%x now 0x%x\n", | 3490 | "%s: First Instruction 0x%x now 0x%x\n", |
3491 | ahd_name(ahd), ahd_name(ahd), first_instr, | 3491 | ahd_name(ahd), ahd_name(ahd), first_instr, |
3492 | seqaddr); | 3492 | seqaddr); |
@@ -3497,7 +3497,7 @@ ahd_clear_critical_section(struct ahd_softc *ahd) | |||
3497 | steps++; | 3497 | steps++; |
3498 | #ifdef AHD_DEBUG | 3498 | #ifdef AHD_DEBUG |
3499 | if ((ahd_debug & AHD_SHOW_MISC) != 0) | 3499 | if ((ahd_debug & AHD_SHOW_MISC) != 0) |
3500 | printf("%s: Single stepping at 0x%x\n", ahd_name(ahd), | 3500 | printk("%s: Single stepping at 0x%x\n", ahd_name(ahd), |
3501 | seqaddr); | 3501 | seqaddr); |
3502 | #endif | 3502 | #endif |
3503 | if (stepping == FALSE) { | 3503 | if (stepping == FALSE) { |
@@ -3601,16 +3601,16 @@ ahd_print_scb(struct scb *scb) | |||
3601 | int i; | 3601 | int i; |
3602 | 3602 | ||
3603 | hscb = scb->hscb; | 3603 | hscb = scb->hscb; |
3604 | printf("scb:%p control:0x%x scsiid:0x%x lun:%d cdb_len:%d\n", | 3604 | printk("scb:%p control:0x%x scsiid:0x%x lun:%d cdb_len:%d\n", |
3605 | (void *)scb, | 3605 | (void *)scb, |
3606 | hscb->control, | 3606 | hscb->control, |
3607 | hscb->scsiid, | 3607 | hscb->scsiid, |
3608 | hscb->lun, | 3608 | hscb->lun, |
3609 | hscb->cdb_len); | 3609 | hscb->cdb_len); |
3610 | printf("Shared Data: "); | 3610 | printk("Shared Data: "); |
3611 | for (i = 0; i < sizeof(hscb->shared_data.idata.cdb); i++) | 3611 | for (i = 0; i < sizeof(hscb->shared_data.idata.cdb); i++) |
3612 | printf("%#02x", hscb->shared_data.idata.cdb[i]); | 3612 | printk("%#02x", hscb->shared_data.idata.cdb[i]); |
3613 | printf(" dataptr:%#x%x datacnt:%#x sgptr:%#x tag:%#x\n", | 3613 | printk(" dataptr:%#x%x datacnt:%#x sgptr:%#x tag:%#x\n", |
3614 | (uint32_t)((ahd_le64toh(hscb->dataptr) >> 32) & 0xFFFFFFFF), | 3614 | (uint32_t)((ahd_le64toh(hscb->dataptr) >> 32) & 0xFFFFFFFF), |
3615 | (uint32_t)(ahd_le64toh(hscb->dataptr) & 0xFFFFFFFF), | 3615 | (uint32_t)(ahd_le64toh(hscb->dataptr) & 0xFFFFFFFF), |
3616 | ahd_le32toh(hscb->datacnt), | 3616 | ahd_le32toh(hscb->datacnt), |
@@ -3637,7 +3637,7 @@ ahd_alloc_tstate(struct ahd_softc *ahd, u_int scsi_id, char channel) | |||
3637 | && ahd->enabled_targets[scsi_id] != master_tstate) | 3637 | && ahd->enabled_targets[scsi_id] != master_tstate) |
3638 | panic("%s: ahd_alloc_tstate - Target already allocated", | 3638 | panic("%s: ahd_alloc_tstate - Target already allocated", |
3639 | ahd_name(ahd)); | 3639 | ahd_name(ahd)); |
3640 | tstate = malloc(sizeof(*tstate), M_DEVBUF, M_NOWAIT); | 3640 | tstate = kmalloc(sizeof(*tstate), GFP_ATOMIC); |
3641 | if (tstate == NULL) | 3641 | if (tstate == NULL) |
3642 | return (NULL); | 3642 | return (NULL); |
3643 | 3643 | ||
@@ -3682,7 +3682,7 @@ ahd_free_tstate(struct ahd_softc *ahd, u_int scsi_id, char channel, int force) | |||
3682 | 3682 | ||
3683 | tstate = ahd->enabled_targets[scsi_id]; | 3683 | tstate = ahd->enabled_targets[scsi_id]; |
3684 | if (tstate != NULL) | 3684 | if (tstate != NULL) |
3685 | free(tstate, M_DEVBUF); | 3685 | kfree(tstate); |
3686 | ahd->enabled_targets[scsi_id] = NULL; | 3686 | ahd->enabled_targets[scsi_id] = NULL; |
3687 | } | 3687 | } |
3688 | #endif | 3688 | #endif |
@@ -3942,37 +3942,37 @@ ahd_set_syncrate(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, | |||
3942 | if (offset != 0) { | 3942 | if (offset != 0) { |
3943 | int options; | 3943 | int options; |
3944 | 3944 | ||
3945 | printf("%s: target %d synchronous with " | 3945 | printk("%s: target %d synchronous with " |
3946 | "period = 0x%x, offset = 0x%x", | 3946 | "period = 0x%x, offset = 0x%x", |
3947 | ahd_name(ahd), devinfo->target, | 3947 | ahd_name(ahd), devinfo->target, |
3948 | period, offset); | 3948 | period, offset); |
3949 | options = 0; | 3949 | options = 0; |
3950 | if ((ppr_options & MSG_EXT_PPR_RD_STRM) != 0) { | 3950 | if ((ppr_options & MSG_EXT_PPR_RD_STRM) != 0) { |
3951 | printf("(RDSTRM"); | 3951 | printk("(RDSTRM"); |
3952 | options++; | 3952 | options++; |
3953 | } | 3953 | } |
3954 | if ((ppr_options & MSG_EXT_PPR_DT_REQ) != 0) { | 3954 | if ((ppr_options & MSG_EXT_PPR_DT_REQ) != 0) { |
3955 | printf("%s", options ? "|DT" : "(DT"); | 3955 | printk("%s", options ? "|DT" : "(DT"); |
3956 | options++; | 3956 | options++; |
3957 | } | 3957 | } |
3958 | if ((ppr_options & MSG_EXT_PPR_IU_REQ) != 0) { | 3958 | if ((ppr_options & MSG_EXT_PPR_IU_REQ) != 0) { |
3959 | printf("%s", options ? "|IU" : "(IU"); | 3959 | printk("%s", options ? "|IU" : "(IU"); |
3960 | options++; | 3960 | options++; |
3961 | } | 3961 | } |
3962 | if ((ppr_options & MSG_EXT_PPR_RTI) != 0) { | 3962 | if ((ppr_options & MSG_EXT_PPR_RTI) != 0) { |
3963 | printf("%s", options ? "|RTI" : "(RTI"); | 3963 | printk("%s", options ? "|RTI" : "(RTI"); |
3964 | options++; | 3964 | options++; |
3965 | } | 3965 | } |
3966 | if ((ppr_options & MSG_EXT_PPR_QAS_REQ) != 0) { | 3966 | if ((ppr_options & MSG_EXT_PPR_QAS_REQ) != 0) { |
3967 | printf("%s", options ? "|QAS" : "(QAS"); | 3967 | printk("%s", options ? "|QAS" : "(QAS"); |
3968 | options++; | 3968 | options++; |
3969 | } | 3969 | } |
3970 | if (options != 0) | 3970 | if (options != 0) |
3971 | printf(")\n"); | 3971 | printk(")\n"); |
3972 | else | 3972 | else |
3973 | printf("\n"); | 3973 | printk("\n"); |
3974 | } else { | 3974 | } else { |
3975 | printf("%s: target %d using " | 3975 | printk("%s: target %d using " |
3976 | "asynchronous transfers%s\n", | 3976 | "asynchronous transfers%s\n", |
3977 | ahd_name(ahd), devinfo->target, | 3977 | ahd_name(ahd), devinfo->target, |
3978 | (ppr_options & MSG_EXT_PPR_QAS_REQ) != 0 | 3978 | (ppr_options & MSG_EXT_PPR_QAS_REQ) != 0 |
@@ -4000,7 +4000,7 @@ ahd_set_syncrate(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, | |||
4000 | #ifdef AHD_DEBUG | 4000 | #ifdef AHD_DEBUG |
4001 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) { | 4001 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) { |
4002 | ahd_print_devinfo(ahd, devinfo); | 4002 | ahd_print_devinfo(ahd, devinfo); |
4003 | printf("Expecting IU Change busfree\n"); | 4003 | printk("Expecting IU Change busfree\n"); |
4004 | } | 4004 | } |
4005 | #endif | 4005 | #endif |
4006 | ahd->msg_flags |= MSG_FLAG_EXPECT_PPR_BUSFREE | 4006 | ahd->msg_flags |= MSG_FLAG_EXPECT_PPR_BUSFREE |
@@ -4009,7 +4009,7 @@ ahd_set_syncrate(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, | |||
4009 | if ((old_ppr & MSG_EXT_PPR_IU_REQ) != 0) { | 4009 | if ((old_ppr & MSG_EXT_PPR_IU_REQ) != 0) { |
4010 | #ifdef AHD_DEBUG | 4010 | #ifdef AHD_DEBUG |
4011 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) | 4011 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) |
4012 | printf("PPR with IU_REQ outstanding\n"); | 4012 | printk("PPR with IU_REQ outstanding\n"); |
4013 | #endif | 4013 | #endif |
4014 | ahd->msg_flags |= MSG_FLAG_EXPECT_PPR_BUSFREE; | 4014 | ahd->msg_flags |= MSG_FLAG_EXPECT_PPR_BUSFREE; |
4015 | } | 4015 | } |
@@ -4061,7 +4061,7 @@ ahd_set_width(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, | |||
4061 | ahd_send_async(ahd, devinfo->channel, devinfo->target, | 4061 | ahd_send_async(ahd, devinfo->channel, devinfo->target, |
4062 | CAM_LUN_WILDCARD, AC_TRANSFER_NEG); | 4062 | CAM_LUN_WILDCARD, AC_TRANSFER_NEG); |
4063 | if (bootverbose) { | 4063 | if (bootverbose) { |
4064 | printf("%s: target %d using %dbit transfers\n", | 4064 | printk("%s: target %d using %dbit transfers\n", |
4065 | ahd_name(ahd), devinfo->target, | 4065 | ahd_name(ahd), devinfo->target, |
4066 | 8 * (0x01 << width)); | 4066 | 8 * (0x01 << width)); |
4067 | } | 4067 | } |
@@ -4337,7 +4337,7 @@ ahd_fetch_devinfo(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) | |||
4337 | void | 4337 | void |
4338 | ahd_print_devinfo(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) | 4338 | ahd_print_devinfo(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) |
4339 | { | 4339 | { |
4340 | printf("%s:%c:%d:%d: ", ahd_name(ahd), 'A', | 4340 | printk("%s:%c:%d:%d: ", ahd_name(ahd), 'A', |
4341 | devinfo->target, devinfo->lun); | 4341 | devinfo->target, devinfo->lun); |
4342 | } | 4342 | } |
4343 | 4343 | ||
@@ -4419,11 +4419,11 @@ ahd_setup_initiator_msgout(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, | |||
4419 | ahd->msg_type = MSG_TYPE_INITIATOR_MSGOUT; | 4419 | ahd->msg_type = MSG_TYPE_INITIATOR_MSGOUT; |
4420 | #ifdef AHD_DEBUG | 4420 | #ifdef AHD_DEBUG |
4421 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) | 4421 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) |
4422 | printf("Setting up for Parity Error delivery\n"); | 4422 | printk("Setting up for Parity Error delivery\n"); |
4423 | #endif | 4423 | #endif |
4424 | return; | 4424 | return; |
4425 | } else if (scb == NULL) { | 4425 | } else if (scb == NULL) { |
4426 | printf("%s: WARNING. No pending message for " | 4426 | printk("%s: WARNING. No pending message for " |
4427 | "I_T msgin. Issuing NO-OP\n", ahd_name(ahd)); | 4427 | "I_T msgin. Issuing NO-OP\n", ahd_name(ahd)); |
4428 | ahd->msgout_buf[ahd->msgout_index++] = MSG_NOOP; | 4428 | ahd->msgout_buf[ahd->msgout_index++] = MSG_NOOP; |
4429 | ahd->msgout_len++; | 4429 | ahd->msgout_len++; |
@@ -4454,7 +4454,7 @@ ahd_setup_initiator_msgout(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, | |||
4454 | ahd->msgout_buf[ahd->msgout_index++] = MSG_BUS_DEV_RESET; | 4454 | ahd->msgout_buf[ahd->msgout_index++] = MSG_BUS_DEV_RESET; |
4455 | ahd->msgout_len++; | 4455 | ahd->msgout_len++; |
4456 | ahd_print_path(ahd, scb); | 4456 | ahd_print_path(ahd, scb); |
4457 | printf("Bus Device Reset Message Sent\n"); | 4457 | printk("Bus Device Reset Message Sent\n"); |
4458 | /* | 4458 | /* |
4459 | * Clear our selection hardware in advance of | 4459 | * Clear our selection hardware in advance of |
4460 | * the busfree. We may have an entry in the waiting | 4460 | * the busfree. We may have an entry in the waiting |
@@ -4472,7 +4472,7 @@ ahd_setup_initiator_msgout(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, | |||
4472 | } | 4472 | } |
4473 | ahd->msgout_len++; | 4473 | ahd->msgout_len++; |
4474 | ahd_print_path(ahd, scb); | 4474 | ahd_print_path(ahd, scb); |
4475 | printf("Abort%s Message Sent\n", | 4475 | printk("Abort%s Message Sent\n", |
4476 | (scb->hscb->control & TAG_ENB) != 0 ? " Tag" : ""); | 4476 | (scb->hscb->control & TAG_ENB) != 0 ? " Tag" : ""); |
4477 | /* | 4477 | /* |
4478 | * Clear our selection hardware in advance of | 4478 | * Clear our selection hardware in advance of |
@@ -4493,9 +4493,9 @@ ahd_setup_initiator_msgout(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, | |||
4493 | */ | 4493 | */ |
4494 | ahd_outb(ahd, SCSISEQ0, 0); | 4494 | ahd_outb(ahd, SCSISEQ0, 0); |
4495 | } else { | 4495 | } else { |
4496 | printf("ahd_intr: AWAITING_MSG for an SCB that " | 4496 | printk("ahd_intr: AWAITING_MSG for an SCB that " |
4497 | "does not have a waiting message\n"); | 4497 | "does not have a waiting message\n"); |
4498 | printf("SCSIID = %x, target_mask = %x\n", scb->hscb->scsiid, | 4498 | printk("SCSIID = %x, target_mask = %x\n", scb->hscb->scsiid, |
4499 | devinfo->target_mask); | 4499 | devinfo->target_mask); |
4500 | panic("SCB = %d, SCB Control = %x:%x, MSG_OUT = %x " | 4500 | panic("SCB = %d, SCB Control = %x:%x, MSG_OUT = %x " |
4501 | "SCB flags = %x", SCB_GET_TAG(scb), scb->hscb->control, | 4501 | "SCB flags = %x", SCB_GET_TAG(scb), scb->hscb->control, |
@@ -4577,7 +4577,7 @@ ahd_build_transfer_msg(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) | |||
4577 | 4577 | ||
4578 | if (bootverbose) { | 4578 | if (bootverbose) { |
4579 | ahd_print_devinfo(ahd, devinfo); | 4579 | ahd_print_devinfo(ahd, devinfo); |
4580 | printf("Ensuring async\n"); | 4580 | printk("Ensuring async\n"); |
4581 | } | 4581 | } |
4582 | } | 4582 | } |
4583 | /* Target initiated PPR is not allowed in the SCSI spec */ | 4583 | /* Target initiated PPR is not allowed in the SCSI spec */ |
@@ -4624,7 +4624,7 @@ ahd_construct_sdtr(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, | |||
4624 | ahd->msgout_buf + ahd->msgout_index, period, offset); | 4624 | ahd->msgout_buf + ahd->msgout_index, period, offset); |
4625 | ahd->msgout_len += 5; | 4625 | ahd->msgout_len += 5; |
4626 | if (bootverbose) { | 4626 | if (bootverbose) { |
4627 | printf("(%s:%c:%d:%d): Sending SDTR period %x, offset %x\n", | 4627 | printk("(%s:%c:%d:%d): Sending SDTR period %x, offset %x\n", |
4628 | ahd_name(ahd), devinfo->channel, devinfo->target, | 4628 | ahd_name(ahd), devinfo->channel, devinfo->target, |
4629 | devinfo->lun, period, offset); | 4629 | devinfo->lun, period, offset); |
4630 | } | 4630 | } |
@@ -4642,7 +4642,7 @@ ahd_construct_wdtr(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, | |||
4642 | ahd->msgout_buf + ahd->msgout_index, bus_width); | 4642 | ahd->msgout_buf + ahd->msgout_index, bus_width); |
4643 | ahd->msgout_len += 4; | 4643 | ahd->msgout_len += 4; |
4644 | if (bootverbose) { | 4644 | if (bootverbose) { |
4645 | printf("(%s:%c:%d:%d): Sending WDTR %x\n", | 4645 | printk("(%s:%c:%d:%d): Sending WDTR %x\n", |
4646 | ahd_name(ahd), devinfo->channel, devinfo->target, | 4646 | ahd_name(ahd), devinfo->channel, devinfo->target, |
4647 | devinfo->lun, bus_width); | 4647 | devinfo->lun, bus_width); |
4648 | } | 4648 | } |
@@ -4671,7 +4671,7 @@ ahd_construct_ppr(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, | |||
4671 | bus_width, ppr_options); | 4671 | bus_width, ppr_options); |
4672 | ahd->msgout_len += 8; | 4672 | ahd->msgout_len += 8; |
4673 | if (bootverbose) { | 4673 | if (bootverbose) { |
4674 | printf("(%s:%c:%d:%d): Sending PPR bus_width %x, period %x, " | 4674 | printk("(%s:%c:%d:%d): Sending PPR bus_width %x, period %x, " |
4675 | "offset %x, ppr_options %x\n", ahd_name(ahd), | 4675 | "offset %x, ppr_options %x\n", ahd_name(ahd), |
4676 | devinfo->channel, devinfo->target, devinfo->lun, | 4676 | devinfo->channel, devinfo->target, devinfo->lun, |
4677 | bus_width, period, offset, ppr_options); | 4677 | bus_width, period, offset, ppr_options); |
@@ -4721,7 +4721,7 @@ ahd_handle_message_phase(struct ahd_softc *ahd) | |||
4721 | bus_phase = ahd_inb(ahd, LASTPHASE); | 4721 | bus_phase = ahd_inb(ahd, LASTPHASE); |
4722 | 4722 | ||
4723 | if ((ahd_inb(ahd, LQISTAT2) & LQIPHASE_OUTPKT) != 0) { | 4723 | if ((ahd_inb(ahd, LQISTAT2) & LQIPHASE_OUTPKT) != 0) { |
4724 | printf("LQIRETRY for LQIPHASE_OUTPKT\n"); | 4724 | printk("LQIRETRY for LQIPHASE_OUTPKT\n"); |
4725 | ahd_outb(ahd, LQCTL2, LQIRETRY); | 4725 | ahd_outb(ahd, LQCTL2, LQIRETRY); |
4726 | } | 4726 | } |
4727 | reswitch: | 4727 | reswitch: |
@@ -4738,14 +4738,14 @@ reswitch: | |||
4738 | #ifdef AHD_DEBUG | 4738 | #ifdef AHD_DEBUG |
4739 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) { | 4739 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) { |
4740 | ahd_print_devinfo(ahd, &devinfo); | 4740 | ahd_print_devinfo(ahd, &devinfo); |
4741 | printf("INITIATOR_MSG_OUT"); | 4741 | printk("INITIATOR_MSG_OUT"); |
4742 | } | 4742 | } |
4743 | #endif | 4743 | #endif |
4744 | phasemis = bus_phase != P_MESGOUT; | 4744 | phasemis = bus_phase != P_MESGOUT; |
4745 | if (phasemis) { | 4745 | if (phasemis) { |
4746 | #ifdef AHD_DEBUG | 4746 | #ifdef AHD_DEBUG |
4747 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) { | 4747 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) { |
4748 | printf(" PHASEMIS %s\n", | 4748 | printk(" PHASEMIS %s\n", |
4749 | ahd_lookup_phase_entry(bus_phase) | 4749 | ahd_lookup_phase_entry(bus_phase) |
4750 | ->phasemsg); | 4750 | ->phasemsg); |
4751 | } | 4751 | } |
@@ -4772,7 +4772,7 @@ reswitch: | |||
4772 | ahd_outb(ahd, CLRSINT1, CLRREQINIT); | 4772 | ahd_outb(ahd, CLRSINT1, CLRREQINIT); |
4773 | #ifdef AHD_DEBUG | 4773 | #ifdef AHD_DEBUG |
4774 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) | 4774 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) |
4775 | printf(" byte 0x%x\n", ahd->send_msg_perror); | 4775 | printk(" byte 0x%x\n", ahd->send_msg_perror); |
4776 | #endif | 4776 | #endif |
4777 | /* | 4777 | /* |
4778 | * If we are notifying the target of a CRC error | 4778 | * If we are notifying the target of a CRC error |
@@ -4813,7 +4813,7 @@ reswitch: | |||
4813 | ahd_outb(ahd, CLRSINT1, CLRREQINIT); | 4813 | ahd_outb(ahd, CLRSINT1, CLRREQINIT); |
4814 | #ifdef AHD_DEBUG | 4814 | #ifdef AHD_DEBUG |
4815 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) | 4815 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) |
4816 | printf(" byte 0x%x\n", | 4816 | printk(" byte 0x%x\n", |
4817 | ahd->msgout_buf[ahd->msgout_index]); | 4817 | ahd->msgout_buf[ahd->msgout_index]); |
4818 | #endif | 4818 | #endif |
4819 | ahd_outb(ahd, RETURN_2, ahd->msgout_buf[ahd->msgout_index++]); | 4819 | ahd_outb(ahd, RETURN_2, ahd->msgout_buf[ahd->msgout_index++]); |
@@ -4828,14 +4828,14 @@ reswitch: | |||
4828 | #ifdef AHD_DEBUG | 4828 | #ifdef AHD_DEBUG |
4829 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) { | 4829 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) { |
4830 | ahd_print_devinfo(ahd, &devinfo); | 4830 | ahd_print_devinfo(ahd, &devinfo); |
4831 | printf("INITIATOR_MSG_IN"); | 4831 | printk("INITIATOR_MSG_IN"); |
4832 | } | 4832 | } |
4833 | #endif | 4833 | #endif |
4834 | phasemis = bus_phase != P_MESGIN; | 4834 | phasemis = bus_phase != P_MESGIN; |
4835 | if (phasemis) { | 4835 | if (phasemis) { |
4836 | #ifdef AHD_DEBUG | 4836 | #ifdef AHD_DEBUG |
4837 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) { | 4837 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) { |
4838 | printf(" PHASEMIS %s\n", | 4838 | printk(" PHASEMIS %s\n", |
4839 | ahd_lookup_phase_entry(bus_phase) | 4839 | ahd_lookup_phase_entry(bus_phase) |
4840 | ->phasemsg); | 4840 | ->phasemsg); |
4841 | } | 4841 | } |
@@ -4856,7 +4856,7 @@ reswitch: | |||
4856 | ahd->msgin_buf[ahd->msgin_index] = ahd_inb(ahd, SCSIBUS); | 4856 | ahd->msgin_buf[ahd->msgin_index] = ahd_inb(ahd, SCSIBUS); |
4857 | #ifdef AHD_DEBUG | 4857 | #ifdef AHD_DEBUG |
4858 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) | 4858 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) |
4859 | printf(" byte 0x%x\n", | 4859 | printk(" byte 0x%x\n", |
4860 | ahd->msgin_buf[ahd->msgin_index]); | 4860 | ahd->msgin_buf[ahd->msgin_index]); |
4861 | #endif | 4861 | #endif |
4862 | 4862 | ||
@@ -4878,7 +4878,7 @@ reswitch: | |||
4878 | #ifdef AHD_DEBUG | 4878 | #ifdef AHD_DEBUG |
4879 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) { | 4879 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) { |
4880 | ahd_print_devinfo(ahd, &devinfo); | 4880 | ahd_print_devinfo(ahd, &devinfo); |
4881 | printf("Asserting ATN for response\n"); | 4881 | printk("Asserting ATN for response\n"); |
4882 | } | 4882 | } |
4883 | #endif | 4883 | #endif |
4884 | ahd_assert_atn(ahd); | 4884 | ahd_assert_atn(ahd); |
@@ -5026,7 +5026,7 @@ reswitch: | |||
5026 | 5026 | ||
5027 | if (end_session) { | 5027 | if (end_session) { |
5028 | if ((ahd->msg_flags & MSG_FLAG_PACKETIZED) != 0) { | 5028 | if ((ahd->msg_flags & MSG_FLAG_PACKETIZED) != 0) { |
5029 | printf("%s: Returning to Idle Loop\n", | 5029 | printk("%s: Returning to Idle Loop\n", |
5030 | ahd_name(ahd)); | 5030 | ahd_name(ahd)); |
5031 | ahd_clear_msg_state(ahd); | 5031 | ahd_clear_msg_state(ahd); |
5032 | 5032 | ||
@@ -5178,7 +5178,7 @@ ahd_parse_msg(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) | |||
5178 | ahd_validate_offset(ahd, tinfo, period, &offset, | 5178 | ahd_validate_offset(ahd, tinfo, period, &offset, |
5179 | tinfo->curr.width, devinfo->role); | 5179 | tinfo->curr.width, devinfo->role); |
5180 | if (bootverbose) { | 5180 | if (bootverbose) { |
5181 | printf("(%s:%c:%d:%d): Received " | 5181 | printk("(%s:%c:%d:%d): Received " |
5182 | "SDTR period %x, offset %x\n\t" | 5182 | "SDTR period %x, offset %x\n\t" |
5183 | "Filtered to period %x, offset %x\n", | 5183 | "Filtered to period %x, offset %x\n", |
5184 | ahd_name(ahd), devinfo->channel, | 5184 | ahd_name(ahd), devinfo->channel, |
@@ -5208,7 +5208,7 @@ ahd_parse_msg(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) | |||
5208 | */ | 5208 | */ |
5209 | if (bootverbose | 5209 | if (bootverbose |
5210 | && devinfo->role == ROLE_INITIATOR) { | 5210 | && devinfo->role == ROLE_INITIATOR) { |
5211 | printf("(%s:%c:%d:%d): Target " | 5211 | printk("(%s:%c:%d:%d): Target " |
5212 | "Initiated SDTR\n", | 5212 | "Initiated SDTR\n", |
5213 | ahd_name(ahd), devinfo->channel, | 5213 | ahd_name(ahd), devinfo->channel, |
5214 | devinfo->target, devinfo->lun); | 5214 | devinfo->target, devinfo->lun); |
@@ -5250,7 +5250,7 @@ ahd_parse_msg(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) | |||
5250 | ahd_validate_width(ahd, tinfo, &bus_width, | 5250 | ahd_validate_width(ahd, tinfo, &bus_width, |
5251 | devinfo->role); | 5251 | devinfo->role); |
5252 | if (bootverbose) { | 5252 | if (bootverbose) { |
5253 | printf("(%s:%c:%d:%d): Received WDTR " | 5253 | printk("(%s:%c:%d:%d): Received WDTR " |
5254 | "%x filtered to %x\n", | 5254 | "%x filtered to %x\n", |
5255 | ahd_name(ahd), devinfo->channel, | 5255 | ahd_name(ahd), devinfo->channel, |
5256 | devinfo->target, devinfo->lun, | 5256 | devinfo->target, devinfo->lun, |
@@ -5266,7 +5266,7 @@ ahd_parse_msg(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) | |||
5266 | */ | 5266 | */ |
5267 | if (saved_width > bus_width) { | 5267 | if (saved_width > bus_width) { |
5268 | reject = TRUE; | 5268 | reject = TRUE; |
5269 | printf("(%s:%c:%d:%d): requested %dBit " | 5269 | printk("(%s:%c:%d:%d): requested %dBit " |
5270 | "transfers. Rejecting...\n", | 5270 | "transfers. Rejecting...\n", |
5271 | ahd_name(ahd), devinfo->channel, | 5271 | ahd_name(ahd), devinfo->channel, |
5272 | devinfo->target, devinfo->lun, | 5272 | devinfo->target, devinfo->lun, |
@@ -5279,7 +5279,7 @@ ahd_parse_msg(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) | |||
5279 | */ | 5279 | */ |
5280 | if (bootverbose | 5280 | if (bootverbose |
5281 | && devinfo->role == ROLE_INITIATOR) { | 5281 | && devinfo->role == ROLE_INITIATOR) { |
5282 | printf("(%s:%c:%d:%d): Target " | 5282 | printk("(%s:%c:%d:%d): Target " |
5283 | "Initiated WDTR\n", | 5283 | "Initiated WDTR\n", |
5284 | ahd_name(ahd), devinfo->channel, | 5284 | ahd_name(ahd), devinfo->channel, |
5285 | devinfo->target, devinfo->lun); | 5285 | devinfo->target, devinfo->lun); |
@@ -5391,12 +5391,12 @@ ahd_parse_msg(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) | |||
5391 | } | 5391 | } |
5392 | } else { | 5392 | } else { |
5393 | if (devinfo->role != ROLE_TARGET) | 5393 | if (devinfo->role != ROLE_TARGET) |
5394 | printf("(%s:%c:%d:%d): Target " | 5394 | printk("(%s:%c:%d:%d): Target " |
5395 | "Initiated PPR\n", | 5395 | "Initiated PPR\n", |
5396 | ahd_name(ahd), devinfo->channel, | 5396 | ahd_name(ahd), devinfo->channel, |
5397 | devinfo->target, devinfo->lun); | 5397 | devinfo->target, devinfo->lun); |
5398 | else | 5398 | else |
5399 | printf("(%s:%c:%d:%d): Initiator " | 5399 | printk("(%s:%c:%d:%d): Initiator " |
5400 | "Initiated PPR\n", | 5400 | "Initiated PPR\n", |
5401 | ahd_name(ahd), devinfo->channel, | 5401 | ahd_name(ahd), devinfo->channel, |
5402 | devinfo->target, devinfo->lun); | 5402 | devinfo->target, devinfo->lun); |
@@ -5408,7 +5408,7 @@ ahd_parse_msg(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) | |||
5408 | response = TRUE; | 5408 | response = TRUE; |
5409 | } | 5409 | } |
5410 | if (bootverbose) { | 5410 | if (bootverbose) { |
5411 | printf("(%s:%c:%d:%d): Received PPR width %x, " | 5411 | printk("(%s:%c:%d:%d): Received PPR width %x, " |
5412 | "period %x, offset %x,options %x\n" | 5412 | "period %x, offset %x,options %x\n" |
5413 | "\tFiltered to width %x, period %x, " | 5413 | "\tFiltered to width %x, period %x, " |
5414 | "offset %x, options %x\n", | 5414 | "offset %x, options %x\n", |
@@ -5484,7 +5484,7 @@ ahd_parse_msg(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) | |||
5484 | case MSG_QAS_REQUEST: | 5484 | case MSG_QAS_REQUEST: |
5485 | #ifdef AHD_DEBUG | 5485 | #ifdef AHD_DEBUG |
5486 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) | 5486 | if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) |
5487 | printf("%s: QAS request. SCSISIGI == 0x%x\n", | 5487 | printk("%s: QAS request. SCSISIGI == 0x%x\n", |
5488 | ahd_name(ahd), ahd_inb(ahd, SCSISIGI)); | 5488 | ahd_name(ahd), ahd_inb(ahd, SCSISIGI)); |
5489 | #endif | 5489 | #endif |
5490 | ahd->msg_flags |= MSG_FLAG_EXPECT_QASREJ_BUSFREE; | 5490 | ahd->msg_flags |= MSG_FLAG_EXPECT_QASREJ_BUSFREE; |
@@ -5549,7 +5549,7 @@ ahd_handle_msg_reject(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) | |||
5549 | * off these options. | 5549 | * off these options. |
5550 | */ | 5550 | */ |
5551 | if (bootverbose) { | 5551 | if (bootverbose) { |
5552 | printf("(%s:%c:%d:%d): PPR Rejected. " | 5552 | printk("(%s:%c:%d:%d): PPR Rejected. " |
5553 | "Trying simple U160 PPR\n", | 5553 | "Trying simple U160 PPR\n", |
5554 | ahd_name(ahd), devinfo->channel, | 5554 | ahd_name(ahd), devinfo->channel, |
5555 | devinfo->target, devinfo->lun); | 5555 | devinfo->target, devinfo->lun); |
@@ -5564,7 +5564,7 @@ ahd_handle_msg_reject(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) | |||
5564 | * Attempt to negotiate SPI-2 style. | 5564 | * Attempt to negotiate SPI-2 style. |
5565 | */ | 5565 | */ |
5566 | if (bootverbose) { | 5566 | if (bootverbose) { |
5567 | printf("(%s:%c:%d:%d): PPR Rejected. " | 5567 | printk("(%s:%c:%d:%d): PPR Rejected. " |
5568 | "Trying WDTR/SDTR\n", | 5568 | "Trying WDTR/SDTR\n", |
5569 | ahd_name(ahd), devinfo->channel, | 5569 | ahd_name(ahd), devinfo->channel, |
5570 | devinfo->target, devinfo->lun); | 5570 | devinfo->target, devinfo->lun); |
@@ -5581,7 +5581,7 @@ ahd_handle_msg_reject(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) | |||
5581 | } else if (ahd_sent_msg(ahd, AHDMSG_EXT, MSG_EXT_WDTR, /*full*/FALSE)) { | 5581 | } else if (ahd_sent_msg(ahd, AHDMSG_EXT, MSG_EXT_WDTR, /*full*/FALSE)) { |
5582 | 5582 | ||
5583 | /* note 8bit xfers */ | 5583 | /* note 8bit xfers */ |
5584 | printf("(%s:%c:%d:%d): refuses WIDE negotiation. Using " | 5584 | printk("(%s:%c:%d:%d): refuses WIDE negotiation. Using " |
5585 | "8bit transfers\n", ahd_name(ahd), | 5585 | "8bit transfers\n", ahd_name(ahd), |
5586 | devinfo->channel, devinfo->target, devinfo->lun); | 5586 | devinfo->channel, devinfo->target, devinfo->lun); |
5587 | ahd_set_width(ahd, devinfo, MSG_EXT_WDTR_BUS_8_BIT, | 5587 | ahd_set_width(ahd, devinfo, MSG_EXT_WDTR_BUS_8_BIT, |
@@ -5609,7 +5609,7 @@ ahd_handle_msg_reject(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) | |||
5609 | /*offset*/0, /*ppr_options*/0, | 5609 | /*offset*/0, /*ppr_options*/0, |
5610 | AHD_TRANS_ACTIVE|AHD_TRANS_GOAL, | 5610 | AHD_TRANS_ACTIVE|AHD_TRANS_GOAL, |
5611 | /*paused*/TRUE); | 5611 | /*paused*/TRUE); |
5612 | printf("(%s:%c:%d:%d): refuses synchronous negotiation. " | 5612 | printk("(%s:%c:%d:%d): refuses synchronous negotiation. " |
5613 | "Using asynchronous transfers\n", | 5613 | "Using asynchronous transfers\n", |
5614 | ahd_name(ahd), devinfo->channel, | 5614 | ahd_name(ahd), devinfo->channel, |
5615 | devinfo->target, devinfo->lun); | 5615 | devinfo->target, devinfo->lun); |
@@ -5620,13 +5620,13 @@ ahd_handle_msg_reject(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) | |||
5620 | tag_type = (scb->hscb->control & MSG_SIMPLE_TASK); | 5620 | tag_type = (scb->hscb->control & MSG_SIMPLE_TASK); |
5621 | 5621 | ||
5622 | if (tag_type == MSG_SIMPLE_TASK) { | 5622 | if (tag_type == MSG_SIMPLE_TASK) { |
5623 | printf("(%s:%c:%d:%d): refuses tagged commands. " | 5623 | printk("(%s:%c:%d:%d): refuses tagged commands. " |
5624 | "Performing non-tagged I/O\n", ahd_name(ahd), | 5624 | "Performing non-tagged I/O\n", ahd_name(ahd), |
5625 | devinfo->channel, devinfo->target, devinfo->lun); | 5625 | devinfo->channel, devinfo->target, devinfo->lun); |
5626 | ahd_set_tags(ahd, scb->io_ctx, devinfo, AHD_QUEUE_NONE); | 5626 | ahd_set_tags(ahd, scb->io_ctx, devinfo, AHD_QUEUE_NONE); |
5627 | mask = ~0x23; | 5627 | mask = ~0x23; |
5628 | } else { | 5628 | } else { |
5629 | printf("(%s:%c:%d:%d): refuses %s tagged commands. " | 5629 | printk("(%s:%c:%d:%d): refuses %s tagged commands. " |
5630 | "Performing simple queue tagged I/O only\n", | 5630 | "Performing simple queue tagged I/O only\n", |
5631 | ahd_name(ahd), devinfo->channel, devinfo->target, | 5631 | ahd_name(ahd), devinfo->channel, devinfo->target, |
5632 | devinfo->lun, tag_type == MSG_ORDERED_TASK | 5632 | devinfo->lun, tag_type == MSG_ORDERED_TASK |
@@ -5677,7 +5677,7 @@ ahd_handle_msg_reject(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) | |||
5677 | /* | 5677 | /* |
5678 | * Otherwise, we ignore it. | 5678 | * Otherwise, we ignore it. |
5679 | */ | 5679 | */ |
5680 | printf("%s:%c:%d: Message reject for %x -- ignored\n", | 5680 | printk("%s:%c:%d: Message reject for %x -- ignored\n", |
5681 | ahd_name(ahd), devinfo->channel, devinfo->target, | 5681 | ahd_name(ahd), devinfo->channel, devinfo->target, |
5682 | last_msg); | 5682 | last_msg); |
5683 | } | 5683 | } |
@@ -5864,7 +5864,7 @@ ahd_reinitialize_dataptrs(struct ahd_softc *ahd) | |||
5864 | ahd_delay(100); | 5864 | ahd_delay(100); |
5865 | if (wait == 0) { | 5865 | if (wait == 0) { |
5866 | ahd_print_path(ahd, scb); | 5866 | ahd_print_path(ahd, scb); |
5867 | printf("ahd_reinitialize_dataptrs: Forcing FIFO free.\n"); | 5867 | printk("ahd_reinitialize_dataptrs: Forcing FIFO free.\n"); |
5868 | ahd_outb(ahd, DFFSXFRCTL, RSTCHN|CLRSHCNT); | 5868 | ahd_outb(ahd, DFFSXFRCTL, RSTCHN|CLRSHCNT); |
5869 | } | 5869 | } |
5870 | saved_modes = ahd_save_modes(ahd); | 5870 | saved_modes = ahd_save_modes(ahd); |
@@ -5978,7 +5978,7 @@ ahd_handle_devreset(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, | |||
5978 | CAM_LUN_WILDCARD, AC_SENT_BDR); | 5978 | CAM_LUN_WILDCARD, AC_SENT_BDR); |
5979 | 5979 | ||
5980 | if (message != NULL && bootverbose) | 5980 | if (message != NULL && bootverbose) |
5981 | printf("%s: %s on %c:%d. %d SCBs aborted\n", ahd_name(ahd), | 5981 | printk("%s: %s on %c:%d. %d SCBs aborted\n", ahd_name(ahd), |
5982 | message, devinfo->channel, devinfo->target, found); | 5982 | message, devinfo->channel, devinfo->target, found); |
5983 | } | 5983 | } |
5984 | 5984 | ||
@@ -6074,23 +6074,22 @@ ahd_alloc(void *platform_arg, char *name) | |||
6074 | struct ahd_softc *ahd; | 6074 | struct ahd_softc *ahd; |
6075 | 6075 | ||
6076 | #ifndef __FreeBSD__ | 6076 | #ifndef __FreeBSD__ |
6077 | ahd = malloc(sizeof(*ahd), M_DEVBUF, M_NOWAIT); | 6077 | ahd = kmalloc(sizeof(*ahd), GFP_ATOMIC); |
6078 | if (!ahd) { | 6078 | if (!ahd) { |
6079 | printf("aic7xxx: cannot malloc softc!\n"); | 6079 | printk("aic7xxx: cannot malloc softc!\n"); |
6080 | free(name, M_DEVBUF); | 6080 | kfree(name); |
6081 | return NULL; | 6081 | return NULL; |
6082 | } | 6082 | } |
6083 | #else | 6083 | #else |
6084 | ahd = device_get_softc((device_t)platform_arg); | 6084 | ahd = device_get_softc((device_t)platform_arg); |
6085 | #endif | 6085 | #endif |
6086 | memset(ahd, 0, sizeof(*ahd)); | 6086 | memset(ahd, 0, sizeof(*ahd)); |
6087 | ahd->seep_config = malloc(sizeof(*ahd->seep_config), | 6087 | ahd->seep_config = kmalloc(sizeof(*ahd->seep_config), GFP_ATOMIC); |
6088 | M_DEVBUF, M_NOWAIT); | ||
6089 | if (ahd->seep_config == NULL) { | 6088 | if (ahd->seep_config == NULL) { |
6090 | #ifndef __FreeBSD__ | 6089 | #ifndef __FreeBSD__ |
6091 | free(ahd, M_DEVBUF); | 6090 | kfree(ahd); |
6092 | #endif | 6091 | #endif |
6093 | free(name, M_DEVBUF); | 6092 | kfree(name); |
6094 | return (NULL); | 6093 | return (NULL); |
6095 | } | 6094 | } |
6096 | LIST_INIT(&ahd->pending_scbs); | 6095 | LIST_INIT(&ahd->pending_scbs); |
@@ -6120,7 +6119,7 @@ ahd_alloc(void *platform_arg, char *name) | |||
6120 | } | 6119 | } |
6121 | #ifdef AHD_DEBUG | 6120 | #ifdef AHD_DEBUG |
6122 | if ((ahd_debug & AHD_SHOW_MEMORY) != 0) { | 6121 | if ((ahd_debug & AHD_SHOW_MEMORY) != 0) { |
6123 | printf("%s: scb size = 0x%x, hscb size = 0x%x\n", | 6122 | printk("%s: scb size = 0x%x, hscb size = 0x%x\n", |
6124 | ahd_name(ahd), (u_int)sizeof(struct scb), | 6123 | ahd_name(ahd), (u_int)sizeof(struct scb), |
6125 | (u_int)sizeof(struct hardware_scb)); | 6124 | (u_int)sizeof(struct hardware_scb)); |
6126 | } | 6125 | } |
@@ -6147,7 +6146,7 @@ void | |||
6147 | ahd_set_name(struct ahd_softc *ahd, char *name) | 6146 | ahd_set_name(struct ahd_softc *ahd, char *name) |
6148 | { | 6147 | { |
6149 | if (ahd->name != NULL) | 6148 | if (ahd->name != NULL) |
6150 | free(ahd->name, M_DEVBUF); | 6149 | kfree(ahd->name); |
6151 | ahd->name = name; | 6150 | ahd->name = name; |
6152 | } | 6151 | } |
6153 | 6152 | ||
@@ -6201,27 +6200,27 @@ ahd_free(struct ahd_softc *ahd) | |||
6201 | lstate = tstate->enabled_luns[j]; | 6200 | lstate = tstate->enabled_luns[j]; |
6202 | if (lstate != NULL) { | 6201 | if (lstate != NULL) { |
6203 | xpt_free_path(lstate->path); | 6202 | xpt_free_path(lstate->path); |
6204 | free(lstate, M_DEVBUF); | 6203 | kfree(lstate); |
6205 | } | 6204 | } |
6206 | } | 6205 | } |
6207 | #endif | 6206 | #endif |
6208 | free(tstate, M_DEVBUF); | 6207 | kfree(tstate); |
6209 | } | 6208 | } |
6210 | } | 6209 | } |
6211 | #ifdef AHD_TARGET_MODE | 6210 | #ifdef AHD_TARGET_MODE |
6212 | if (ahd->black_hole != NULL) { | 6211 | if (ahd->black_hole != NULL) { |
6213 | xpt_free_path(ahd->black_hole->path); | 6212 | xpt_free_path(ahd->black_hole->path); |
6214 | free(ahd->black_hole, M_DEVBUF); | 6213 | kfree(ahd->black_hole); |
6215 | } | 6214 | } |
6216 | #endif | 6215 | #endif |
6217 | if (ahd->name != NULL) | 6216 | if (ahd->name != NULL) |
6218 | free(ahd->name, M_DEVBUF); | 6217 | kfree(ahd->name); |
6219 | if (ahd->seep_config != NULL) | 6218 | if (ahd->seep_config != NULL) |
6220 | free(ahd->seep_config, M_DEVBUF); | 6219 | kfree(ahd->seep_config); |
6221 | if (ahd->saved_stack != NULL) | 6220 | if (ahd->saved_stack != NULL) |
6222 | free(ahd->saved_stack, M_DEVBUF); | 6221 | kfree(ahd->saved_stack); |
6223 | #ifndef __FreeBSD__ | 6222 | #ifndef __FreeBSD__ |
6224 | free(ahd, M_DEVBUF); | 6223 | kfree(ahd); |
6225 | #endif | 6224 | #endif |
6226 | return; | 6225 | return; |
6227 | } | 6226 | } |
@@ -6300,7 +6299,7 @@ ahd_reset(struct ahd_softc *ahd, int reinit) | |||
6300 | } while (--wait && !(ahd_inb(ahd, HCNTRL) & CHIPRSTACK)); | 6299 | } while (--wait && !(ahd_inb(ahd, HCNTRL) & CHIPRSTACK)); |
6301 | 6300 | ||
6302 | if (wait == 0) { | 6301 | if (wait == 0) { |
6303 | printf("%s: WARNING - Failed chip reset! " | 6302 | printk("%s: WARNING - Failed chip reset! " |
6304 | "Trying to initialize anyway.\n", ahd_name(ahd)); | 6303 | "Trying to initialize anyway.\n", ahd_name(ahd)); |
6305 | } | 6304 | } |
6306 | ahd_outb(ahd, HCNTRL, ahd->pause); | 6305 | ahd_outb(ahd, HCNTRL, ahd->pause); |
@@ -6422,7 +6421,7 @@ ahd_init_scbdata(struct ahd_softc *ahd) | |||
6422 | /* Determine the number of hardware SCBs and initialize them */ | 6421 | /* Determine the number of hardware SCBs and initialize them */ |
6423 | scb_data->maxhscbs = ahd_probe_scbs(ahd); | 6422 | scb_data->maxhscbs = ahd_probe_scbs(ahd); |
6424 | if (scb_data->maxhscbs == 0) { | 6423 | if (scb_data->maxhscbs == 0) { |
6425 | printf("%s: No SCB space found\n", ahd_name(ahd)); | 6424 | printk("%s: No SCB space found\n", ahd_name(ahd)); |
6426 | return (ENXIO); | 6425 | return (ENXIO); |
6427 | } | 6426 | } |
6428 | 6427 | ||
@@ -6465,7 +6464,7 @@ ahd_init_scbdata(struct ahd_softc *ahd) | |||
6465 | } | 6464 | } |
6466 | #ifdef AHD_DEBUG | 6465 | #ifdef AHD_DEBUG |
6467 | if ((ahd_debug & AHD_SHOW_MEMORY) != 0) | 6466 | if ((ahd_debug & AHD_SHOW_MEMORY) != 0) |
6468 | printf("%s: ahd_sglist_allocsize = 0x%x\n", ahd_name(ahd), | 6467 | printk("%s: ahd_sglist_allocsize = 0x%x\n", ahd_name(ahd), |
6469 | ahd_sglist_allocsize(ahd)); | 6468 | ahd_sglist_allocsize(ahd)); |
6470 | #endif | 6469 | #endif |
6471 | 6470 | ||
@@ -6489,7 +6488,7 @@ ahd_init_scbdata(struct ahd_softc *ahd) | |||
6489 | ahd_alloc_scbs(ahd); | 6488 | ahd_alloc_scbs(ahd); |
6490 | 6489 | ||
6491 | if (scb_data->numscbs == 0) { | 6490 | if (scb_data->numscbs == 0) { |
6492 | printf("%s: ahd_init_scbdata - " | 6491 | printk("%s: ahd_init_scbdata - " |
6493 | "Unable to allocate initial scbs\n", | 6492 | "Unable to allocate initial scbs\n", |
6494 | ahd_name(ahd)); | 6493 | ahd_name(ahd)); |
6495 | goto error_exit; | 6494 | goto error_exit; |
@@ -6564,7 +6563,7 @@ ahd_fini_scbdata(struct ahd_softc *ahd) | |||
6564 | sns_map->dmamap); | 6563 | sns_map->dmamap); |
6565 | ahd_dmamem_free(ahd, scb_data->sense_dmat, | 6564 | ahd_dmamem_free(ahd, scb_data->sense_dmat, |
6566 | sns_map->vaddr, sns_map->dmamap); | 6565 | sns_map->vaddr, sns_map->dmamap); |
6567 | free(sns_map, M_DEVBUF); | 6566 | kfree(sns_map); |
6568 | } | 6567 | } |
6569 | ahd_dma_tag_destroy(ahd, scb_data->sense_dmat); | 6568 | ahd_dma_tag_destroy(ahd, scb_data->sense_dmat); |
6570 | /* FALLTHROUGH */ | 6569 | /* FALLTHROUGH */ |
@@ -6579,7 +6578,7 @@ ahd_fini_scbdata(struct ahd_softc *ahd) | |||
6579 | sg_map->dmamap); | 6578 | sg_map->dmamap); |
6580 | ahd_dmamem_free(ahd, scb_data->sg_dmat, | 6579 | ahd_dmamem_free(ahd, scb_data->sg_dmat, |
6581 | sg_map->vaddr, sg_map->dmamap); | 6580 | sg_map->vaddr, sg_map->dmamap); |
6582 | free(sg_map, M_DEVBUF); | 6581 | kfree(sg_map); |
6583 | } | 6582 | } |
6584 | ahd_dma_tag_destroy(ahd, scb_data->sg_dmat); | 6583 | ahd_dma_tag_destroy(ahd, scb_data->sg_dmat); |
6585 | /* FALLTHROUGH */ | 6584 | /* FALLTHROUGH */ |
@@ -6594,7 +6593,7 @@ ahd_fini_scbdata(struct ahd_softc *ahd) | |||
6594 | hscb_map->dmamap); | 6593 | hscb_map->dmamap); |
6595 | ahd_dmamem_free(ahd, scb_data->hscb_dmat, | 6594 | ahd_dmamem_free(ahd, scb_data->hscb_dmat, |
6596 | hscb_map->vaddr, hscb_map->dmamap); | 6595 | hscb_map->vaddr, hscb_map->dmamap); |
6597 | free(hscb_map, M_DEVBUF); | 6596 | kfree(hscb_map); |
6598 | } | 6597 | } |
6599 | ahd_dma_tag_destroy(ahd, scb_data->hscb_dmat); | 6598 | ahd_dma_tag_destroy(ahd, scb_data->hscb_dmat); |
6600 | /* FALLTHROUGH */ | 6599 | /* FALLTHROUGH */ |
@@ -6624,7 +6623,7 @@ ahd_setup_iocell_workaround(struct ahd_softc *ahd) | |||
6624 | ahd_outb(ahd, SIMODE0, ahd_inb(ahd, SIMODE0) | (ENSELDO|ENSELDI)); | 6623 | ahd_outb(ahd, SIMODE0, ahd_inb(ahd, SIMODE0) | (ENSELDO|ENSELDI)); |
6625 | #ifdef AHD_DEBUG | 6624 | #ifdef AHD_DEBUG |
6626 | if ((ahd_debug & AHD_SHOW_MISC) != 0) | 6625 | if ((ahd_debug & AHD_SHOW_MISC) != 0) |
6627 | printf("%s: Setting up iocell workaround\n", ahd_name(ahd)); | 6626 | printk("%s: Setting up iocell workaround\n", ahd_name(ahd)); |
6628 | #endif | 6627 | #endif |
6629 | ahd_restore_modes(ahd, saved_modes); | 6628 | ahd_restore_modes(ahd, saved_modes); |
6630 | ahd->flags &= ~AHD_HAD_FIRST_SEL; | 6629 | ahd->flags &= ~AHD_HAD_FIRST_SEL; |
@@ -6644,14 +6643,14 @@ ahd_iocell_first_selection(struct ahd_softc *ahd) | |||
6644 | ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG); | 6643 | ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG); |
6645 | #ifdef AHD_DEBUG | 6644 | #ifdef AHD_DEBUG |
6646 | if ((ahd_debug & AHD_SHOW_MISC) != 0) | 6645 | if ((ahd_debug & AHD_SHOW_MISC) != 0) |
6647 | printf("%s: iocell first selection\n", ahd_name(ahd)); | 6646 | printk("%s: iocell first selection\n", ahd_name(ahd)); |
6648 | #endif | 6647 | #endif |
6649 | if ((sblkctl & ENAB40) != 0) { | 6648 | if ((sblkctl & ENAB40) != 0) { |
6650 | ahd_outb(ahd, DSPDATACTL, | 6649 | ahd_outb(ahd, DSPDATACTL, |
6651 | ahd_inb(ahd, DSPDATACTL) & ~BYPASSENAB); | 6650 | ahd_inb(ahd, DSPDATACTL) & ~BYPASSENAB); |
6652 | #ifdef AHD_DEBUG | 6651 | #ifdef AHD_DEBUG |
6653 | if ((ahd_debug & AHD_SHOW_MISC) != 0) | 6652 | if ((ahd_debug & AHD_SHOW_MISC) != 0) |
6654 | printf("%s: BYPASS now disabled\n", ahd_name(ahd)); | 6653 | printk("%s: BYPASS now disabled\n", ahd_name(ahd)); |
6655 | #endif | 6654 | #endif |
6656 | } | 6655 | } |
6657 | ahd_outb(ahd, SIMODE0, ahd_inb(ahd, SIMODE0) & ~(ENSELDO|ENSELDI)); | 6656 | ahd_outb(ahd, SIMODE0, ahd_inb(ahd, SIMODE0) & ~(ENSELDO|ENSELDI)); |
@@ -6833,7 +6832,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) | |||
6833 | hscb = &((struct hardware_scb *)hscb_map->vaddr)[offset]; | 6832 | hscb = &((struct hardware_scb *)hscb_map->vaddr)[offset]; |
6834 | hscb_busaddr = hscb_map->physaddr + (offset * sizeof(*hscb)); | 6833 | hscb_busaddr = hscb_map->physaddr + (offset * sizeof(*hscb)); |
6835 | } else { | 6834 | } else { |
6836 | hscb_map = malloc(sizeof(*hscb_map), M_DEVBUF, M_NOWAIT); | 6835 | hscb_map = kmalloc(sizeof(*hscb_map), GFP_ATOMIC); |
6837 | 6836 | ||
6838 | if (hscb_map == NULL) | 6837 | if (hscb_map == NULL) |
6839 | return; | 6838 | return; |
@@ -6842,7 +6841,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) | |||
6842 | if (ahd_dmamem_alloc(ahd, scb_data->hscb_dmat, | 6841 | if (ahd_dmamem_alloc(ahd, scb_data->hscb_dmat, |
6843 | (void **)&hscb_map->vaddr, | 6842 | (void **)&hscb_map->vaddr, |
6844 | BUS_DMA_NOWAIT, &hscb_map->dmamap) != 0) { | 6843 | BUS_DMA_NOWAIT, &hscb_map->dmamap) != 0) { |
6845 | free(hscb_map, M_DEVBUF); | 6844 | kfree(hscb_map); |
6846 | return; | 6845 | return; |
6847 | } | 6846 | } |
6848 | 6847 | ||
@@ -6866,7 +6865,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) | |||
6866 | segs = sg_map->vaddr + offset; | 6865 | segs = sg_map->vaddr + offset; |
6867 | sg_busaddr = sg_map->physaddr + offset; | 6866 | sg_busaddr = sg_map->physaddr + offset; |
6868 | } else { | 6867 | } else { |
6869 | sg_map = malloc(sizeof(*sg_map), M_DEVBUF, M_NOWAIT); | 6868 | sg_map = kmalloc(sizeof(*sg_map), GFP_ATOMIC); |
6870 | 6869 | ||
6871 | if (sg_map == NULL) | 6870 | if (sg_map == NULL) |
6872 | return; | 6871 | return; |
@@ -6875,7 +6874,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) | |||
6875 | if (ahd_dmamem_alloc(ahd, scb_data->sg_dmat, | 6874 | if (ahd_dmamem_alloc(ahd, scb_data->sg_dmat, |
6876 | (void **)&sg_map->vaddr, | 6875 | (void **)&sg_map->vaddr, |
6877 | BUS_DMA_NOWAIT, &sg_map->dmamap) != 0) { | 6876 | BUS_DMA_NOWAIT, &sg_map->dmamap) != 0) { |
6878 | free(sg_map, M_DEVBUF); | 6877 | kfree(sg_map); |
6879 | return; | 6878 | return; |
6880 | } | 6879 | } |
6881 | 6880 | ||
@@ -6891,7 +6890,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) | |||
6891 | ahd_sglist_allocsize(ahd) / ahd_sglist_size(ahd); | 6890 | ahd_sglist_allocsize(ahd) / ahd_sglist_size(ahd); |
6892 | #ifdef AHD_DEBUG | 6891 | #ifdef AHD_DEBUG |
6893 | if (ahd_debug & AHD_SHOW_MEMORY) | 6892 | if (ahd_debug & AHD_SHOW_MEMORY) |
6894 | printf("Mapped SG data\n"); | 6893 | printk("Mapped SG data\n"); |
6895 | #endif | 6894 | #endif |
6896 | } | 6895 | } |
6897 | 6896 | ||
@@ -6903,7 +6902,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) | |||
6903 | sense_data = sense_map->vaddr + offset; | 6902 | sense_data = sense_map->vaddr + offset; |
6904 | sense_busaddr = sense_map->physaddr + offset; | 6903 | sense_busaddr = sense_map->physaddr + offset; |
6905 | } else { | 6904 | } else { |
6906 | sense_map = malloc(sizeof(*sense_map), M_DEVBUF, M_NOWAIT); | 6905 | sense_map = kmalloc(sizeof(*sense_map), GFP_ATOMIC); |
6907 | 6906 | ||
6908 | if (sense_map == NULL) | 6907 | if (sense_map == NULL) |
6909 | return; | 6908 | return; |
@@ -6912,7 +6911,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) | |||
6912 | if (ahd_dmamem_alloc(ahd, scb_data->sense_dmat, | 6911 | if (ahd_dmamem_alloc(ahd, scb_data->sense_dmat, |
6913 | (void **)&sense_map->vaddr, | 6912 | (void **)&sense_map->vaddr, |
6914 | BUS_DMA_NOWAIT, &sense_map->dmamap) != 0) { | 6913 | BUS_DMA_NOWAIT, &sense_map->dmamap) != 0) { |
6915 | free(sense_map, M_DEVBUF); | 6914 | kfree(sense_map); |
6916 | return; | 6915 | return; |
6917 | } | 6916 | } |
6918 | 6917 | ||
@@ -6927,7 +6926,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) | |||
6927 | scb_data->sense_left = PAGE_SIZE / AHD_SENSE_BUFSIZE; | 6926 | scb_data->sense_left = PAGE_SIZE / AHD_SENSE_BUFSIZE; |
6928 | #ifdef AHD_DEBUG | 6927 | #ifdef AHD_DEBUG |
6929 | if (ahd_debug & AHD_SHOW_MEMORY) | 6928 | if (ahd_debug & AHD_SHOW_MEMORY) |
6930 | printf("Mapped sense data\n"); | 6929 | printk("Mapped sense data\n"); |
6931 | #endif | 6930 | #endif |
6932 | } | 6931 | } |
6933 | 6932 | ||
@@ -6941,15 +6940,13 @@ ahd_alloc_scbs(struct ahd_softc *ahd) | |||
6941 | int error; | 6940 | int error; |
6942 | #endif | 6941 | #endif |
6943 | 6942 | ||
6944 | next_scb = (struct scb *)malloc(sizeof(*next_scb), | 6943 | next_scb = kmalloc(sizeof(*next_scb), GFP_ATOMIC); |
6945 | M_DEVBUF, M_NOWAIT); | ||
6946 | if (next_scb == NULL) | 6944 | if (next_scb == NULL) |
6947 | break; | 6945 | break; |
6948 | 6946 | ||
6949 | pdata = (struct scb_platform_data *)malloc(sizeof(*pdata), | 6947 | pdata = kmalloc(sizeof(*pdata), GFP_ATOMIC); |
6950 | M_DEVBUF, M_NOWAIT); | ||
6951 | if (pdata == NULL) { | 6948 | if (pdata == NULL) { |
6952 | free(next_scb, M_DEVBUF); | 6949 | kfree(next_scb); |
6953 | break; | 6950 | break; |
6954 | } | 6951 | } |
6955 | next_scb->platform_data = pdata; | 6952 | next_scb->platform_data = pdata; |
@@ -6979,8 +6976,8 @@ ahd_alloc_scbs(struct ahd_softc *ahd) | |||
6979 | error = ahd_dmamap_create(ahd, ahd->buffer_dmat, /*flags*/0, | 6976 | error = ahd_dmamap_create(ahd, ahd->buffer_dmat, /*flags*/0, |
6980 | &next_scb->dmamap); | 6977 | &next_scb->dmamap); |
6981 | if (error != 0) { | 6978 | if (error != 0) { |
6982 | free(next_scb, M_DEVBUF); | 6979 | kfree(next_scb); |
6983 | free(pdata, M_DEVBUF); | 6980 | kfree(pdata); |
6984 | break; | 6981 | break; |
6985 | } | 6982 | } |
6986 | #endif | 6983 | #endif |
@@ -7077,8 +7074,7 @@ ahd_init(struct ahd_softc *ahd) | |||
7077 | AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK); | 7074 | AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK); |
7078 | 7075 | ||
7079 | ahd->stack_size = ahd_probe_stack_size(ahd); | 7076 | ahd->stack_size = ahd_probe_stack_size(ahd); |
7080 | ahd->saved_stack = malloc(ahd->stack_size * sizeof(uint16_t), | 7077 | ahd->saved_stack = kmalloc(ahd->stack_size * sizeof(uint16_t), GFP_ATOMIC); |
7081 | M_DEVBUF, M_NOWAIT); | ||
7082 | if (ahd->saved_stack == NULL) | 7078 | if (ahd->saved_stack == NULL) |
7083 | return (ENOMEM); | 7079 | return (ENOMEM); |
7084 | 7080 | ||
@@ -7224,20 +7220,20 @@ ahd_init(struct ahd_softc *ahd) | |||
7224 | error = ahd_write_flexport(ahd, FLXADDR_ROMSTAT_CURSENSECTL, | 7220 | error = ahd_write_flexport(ahd, FLXADDR_ROMSTAT_CURSENSECTL, |
7225 | CURSENSE_ENB); | 7221 | CURSENSE_ENB); |
7226 | if (error != 0) { | 7222 | if (error != 0) { |
7227 | printf("%s: current sensing timeout 1\n", ahd_name(ahd)); | 7223 | printk("%s: current sensing timeout 1\n", ahd_name(ahd)); |
7228 | goto init_done; | 7224 | goto init_done; |
7229 | } | 7225 | } |
7230 | for (i = 20, fstat = FLX_FSTAT_BUSY; | 7226 | for (i = 20, fstat = FLX_FSTAT_BUSY; |
7231 | (fstat & FLX_FSTAT_BUSY) != 0 && i; i--) { | 7227 | (fstat & FLX_FSTAT_BUSY) != 0 && i; i--) { |
7232 | error = ahd_read_flexport(ahd, FLXADDR_FLEXSTAT, &fstat); | 7228 | error = ahd_read_flexport(ahd, FLXADDR_FLEXSTAT, &fstat); |
7233 | if (error != 0) { | 7229 | if (error != 0) { |
7234 | printf("%s: current sensing timeout 2\n", | 7230 | printk("%s: current sensing timeout 2\n", |
7235 | ahd_name(ahd)); | 7231 | ahd_name(ahd)); |
7236 | goto init_done; | 7232 | goto init_done; |
7237 | } | 7233 | } |
7238 | } | 7234 | } |
7239 | if (i == 0) { | 7235 | if (i == 0) { |
7240 | printf("%s: Timedout during current-sensing test\n", | 7236 | printk("%s: Timedout during current-sensing test\n", |
7241 | ahd_name(ahd)); | 7237 | ahd_name(ahd)); |
7242 | goto init_done; | 7238 | goto init_done; |
7243 | } | 7239 | } |
@@ -7245,7 +7241,7 @@ ahd_init(struct ahd_softc *ahd) | |||
7245 | /* Latch Current Sensing status. */ | 7241 | /* Latch Current Sensing status. */ |
7246 | error = ahd_read_flexport(ahd, FLXADDR_CURRENT_STAT, ¤t_sensing); | 7242 | error = ahd_read_flexport(ahd, FLXADDR_CURRENT_STAT, ¤t_sensing); |
7247 | if (error != 0) { | 7243 | if (error != 0) { |
7248 | printf("%s: current sensing timeout 3\n", ahd_name(ahd)); | 7244 | printk("%s: current sensing timeout 3\n", ahd_name(ahd)); |
7249 | goto init_done; | 7245 | goto init_done; |
7250 | } | 7246 | } |
7251 | 7247 | ||
@@ -7254,7 +7250,7 @@ ahd_init(struct ahd_softc *ahd) | |||
7254 | 7250 | ||
7255 | #ifdef AHD_DEBUG | 7251 | #ifdef AHD_DEBUG |
7256 | if ((ahd_debug & AHD_SHOW_TERMCTL) != 0) { | 7252 | if ((ahd_debug & AHD_SHOW_TERMCTL) != 0) { |
7257 | printf("%s: current_sensing == 0x%x\n", | 7253 | printk("%s: current_sensing == 0x%x\n", |
7258 | ahd_name(ahd), current_sensing); | 7254 | ahd_name(ahd), current_sensing); |
7259 | } | 7255 | } |
7260 | #endif | 7256 | #endif |
@@ -7271,13 +7267,13 @@ ahd_init(struct ahd_softc *ahd) | |||
7271 | case FLX_CSTAT_OKAY: | 7267 | case FLX_CSTAT_OKAY: |
7272 | if (warn_user == 0 && bootverbose == 0) | 7268 | if (warn_user == 0 && bootverbose == 0) |
7273 | break; | 7269 | break; |
7274 | printf("%s: %s Channel %s\n", ahd_name(ahd), | 7270 | printk("%s: %s Channel %s\n", ahd_name(ahd), |
7275 | channel_strings[i], termstat_strings[term_stat]); | 7271 | channel_strings[i], termstat_strings[term_stat]); |
7276 | break; | 7272 | break; |
7277 | } | 7273 | } |
7278 | } | 7274 | } |
7279 | if (warn_user) { | 7275 | if (warn_user) { |
7280 | printf("%s: WARNING. Termination is not configured correctly.\n" | 7276 | printk("%s: WARNING. Termination is not configured correctly.\n" |
7281 | "%s: WARNING. SCSI bus operations may FAIL.\n", | 7277 | "%s: WARNING. SCSI bus operations may FAIL.\n", |
7282 | ahd_name(ahd), ahd_name(ahd)); | 7278 | ahd_name(ahd), ahd_name(ahd)); |
7283 | } | 7279 | } |
@@ -7393,7 +7389,7 @@ ahd_chip_init(struct ahd_softc *ahd) | |||
7393 | } | 7389 | } |
7394 | #ifdef AHD_DEBUG | 7390 | #ifdef AHD_DEBUG |
7395 | if ((ahd_debug & AHD_SHOW_MISC) != 0) | 7391 | if ((ahd_debug & AHD_SHOW_MISC) != 0) |
7396 | printf("%s: WRTBIASCTL now 0x%x\n", ahd_name(ahd), | 7392 | printk("%s: WRTBIASCTL now 0x%x\n", ahd_name(ahd), |
7397 | WRTBIASCTL_HP_DEFAULT); | 7393 | WRTBIASCTL_HP_DEFAULT); |
7398 | #endif | 7394 | #endif |
7399 | } | 7395 | } |
@@ -7622,9 +7618,9 @@ ahd_chip_init(struct ahd_softc *ahd) | |||
7622 | ahd_outb(ahd, NEGCONOPTS, negodat3); | 7618 | ahd_outb(ahd, NEGCONOPTS, negodat3); |
7623 | negodat3 = ahd_inb(ahd, NEGCONOPTS); | 7619 | negodat3 = ahd_inb(ahd, NEGCONOPTS); |
7624 | if (!(negodat3 & ENSLOWCRC)) | 7620 | if (!(negodat3 & ENSLOWCRC)) |
7625 | printf("aic79xx: failed to set the SLOWCRC bit\n"); | 7621 | printk("aic79xx: failed to set the SLOWCRC bit\n"); |
7626 | else | 7622 | else |
7627 | printf("aic79xx: SLOWCRC bit set\n"); | 7623 | printk("aic79xx: SLOWCRC bit set\n"); |
7628 | } | 7624 | } |
7629 | } | 7625 | } |
7630 | 7626 | ||
@@ -7646,7 +7642,7 @@ ahd_default_config(struct ahd_softc *ahd) | |||
7646 | * data for any target mode initiator. | 7642 | * data for any target mode initiator. |
7647 | */ | 7643 | */ |
7648 | if (ahd_alloc_tstate(ahd, ahd->our_id, 'A') == NULL) { | 7644 | if (ahd_alloc_tstate(ahd, ahd->our_id, 'A') == NULL) { |
7649 | printf("%s: unable to allocate ahd_tmode_tstate. " | 7645 | printk("%s: unable to allocate ahd_tmode_tstate. " |
7650 | "Failing attach\n", ahd_name(ahd)); | 7646 | "Failing attach\n", ahd_name(ahd)); |
7651 | return (ENOMEM); | 7647 | return (ENOMEM); |
7652 | } | 7648 | } |
@@ -7725,7 +7721,7 @@ ahd_parse_cfgdata(struct ahd_softc *ahd, struct seeprom_config *sc) | |||
7725 | * data for any target mode initiator. | 7721 | * data for any target mode initiator. |
7726 | */ | 7722 | */ |
7727 | if (ahd_alloc_tstate(ahd, ahd->our_id, 'A') == NULL) { | 7723 | if (ahd_alloc_tstate(ahd, ahd->our_id, 'A') == NULL) { |
7728 | printf("%s: unable to allocate ahd_tmode_tstate. " | 7724 | printk("%s: unable to allocate ahd_tmode_tstate. " |
7729 | "Failing attach\n", ahd_name(ahd)); | 7725 | "Failing attach\n", ahd_name(ahd)); |
7730 | return (ENOMEM); | 7726 | return (ENOMEM); |
7731 | } | 7727 | } |
@@ -7795,7 +7791,7 @@ ahd_parse_cfgdata(struct ahd_softc *ahd, struct seeprom_config *sc) | |||
7795 | user_tinfo->width = MSG_EXT_WDTR_BUS_8_BIT; | 7791 | user_tinfo->width = MSG_EXT_WDTR_BUS_8_BIT; |
7796 | #ifdef AHD_DEBUG | 7792 | #ifdef AHD_DEBUG |
7797 | if ((ahd_debug & AHD_SHOW_MISC) != 0) | 7793 | if ((ahd_debug & AHD_SHOW_MISC) != 0) |
7798 | printf("(%d): %x:%x:%x:%x\n", targ, user_tinfo->width, | 7794 | printk("(%d): %x:%x:%x:%x\n", targ, user_tinfo->width, |
7799 | user_tinfo->period, user_tinfo->offset, | 7795 | user_tinfo->period, user_tinfo->offset, |
7800 | user_tinfo->ppr_options); | 7796 | user_tinfo->ppr_options); |
7801 | #endif | 7797 | #endif |
@@ -7951,7 +7947,7 @@ ahd_pause_and_flushwork(struct ahd_softc *ahd) | |||
7951 | || (ahd_inb(ahd, SSTAT0) & (SELDO|SELINGO)) != 0)); | 7947 | || (ahd_inb(ahd, SSTAT0) & (SELDO|SELINGO)) != 0)); |
7952 | 7948 | ||
7953 | if (maxloops == 0) { | 7949 | if (maxloops == 0) { |
7954 | printf("Infinite interrupt loop, INTSTAT = %x", | 7950 | printk("Infinite interrupt loop, INTSTAT = %x", |
7955 | ahd_inb(ahd, INTSTAT)); | 7951 | ahd_inb(ahd, INTSTAT)); |
7956 | } | 7952 | } |
7957 | ahd->qfreeze_cnt++; | 7953 | ahd->qfreeze_cnt++; |
@@ -8241,7 +8237,7 @@ ahd_search_qinfifo(struct ahd_softc *ahd, int target, char channel, | |||
8241 | prev_scb = NULL; | 8237 | prev_scb = NULL; |
8242 | 8238 | ||
8243 | if (action == SEARCH_PRINT) { | 8239 | if (action == SEARCH_PRINT) { |
8244 | printf("qinstart = %d qinfifonext = %d\nQINFIFO:", | 8240 | printk("qinstart = %d qinfifonext = %d\nQINFIFO:", |
8245 | qinstart, ahd->qinfifonext); | 8241 | qinstart, ahd->qinfifonext); |
8246 | } | 8242 | } |
8247 | 8243 | ||
@@ -8256,7 +8252,7 @@ ahd_search_qinfifo(struct ahd_softc *ahd, int target, char channel, | |||
8256 | while (qinpos != qintail) { | 8252 | while (qinpos != qintail) { |
8257 | scb = ahd_lookup_scb(ahd, ahd->qinfifo[qinpos]); | 8253 | scb = ahd_lookup_scb(ahd, ahd->qinfifo[qinpos]); |
8258 | if (scb == NULL) { | 8254 | if (scb == NULL) { |
8259 | printf("qinpos = %d, SCB index = %d\n", | 8255 | printk("qinpos = %d, SCB index = %d\n", |
8260 | qinpos, ahd->qinfifo[qinpos]); | 8256 | qinpos, ahd->qinfifo[qinpos]); |
8261 | panic("Loop 1\n"); | 8257 | panic("Loop 1\n"); |
8262 | } | 8258 | } |
@@ -8269,13 +8265,13 @@ ahd_search_qinfifo(struct ahd_softc *ahd, int target, char channel, | |||
8269 | switch (action) { | 8265 | switch (action) { |
8270 | case SEARCH_COMPLETE: | 8266 | case SEARCH_COMPLETE: |
8271 | if ((scb->flags & SCB_ACTIVE) == 0) | 8267 | if ((scb->flags & SCB_ACTIVE) == 0) |
8272 | printf("Inactive SCB in qinfifo\n"); | 8268 | printk("Inactive SCB in qinfifo\n"); |
8273 | ahd_done_with_status(ahd, scb, status); | 8269 | ahd_done_with_status(ahd, scb, status); |
8274 | /* FALLTHROUGH */ | 8270 | /* FALLTHROUGH */ |
8275 | case SEARCH_REMOVE: | 8271 | case SEARCH_REMOVE: |
8276 | break; | 8272 | break; |
8277 | case SEARCH_PRINT: | 8273 | case SEARCH_PRINT: |
8278 | printf(" 0x%x", ahd->qinfifo[qinpos]); | 8274 | printk(" 0x%x", ahd->qinfifo[qinpos]); |
8279 | /* FALLTHROUGH */ | 8275 | /* FALLTHROUGH */ |
8280 | case SEARCH_COUNT: | 8276 | case SEARCH_COUNT: |
8281 | ahd_qinfifo_requeue(ahd, prev_scb, scb); | 8277 | ahd_qinfifo_requeue(ahd, prev_scb, scb); |
@@ -8292,7 +8288,7 @@ ahd_search_qinfifo(struct ahd_softc *ahd, int target, char channel, | |||
8292 | ahd_set_hnscb_qoff(ahd, ahd->qinfifonext); | 8288 | ahd_set_hnscb_qoff(ahd, ahd->qinfifonext); |
8293 | 8289 | ||
8294 | if (action == SEARCH_PRINT) | 8290 | if (action == SEARCH_PRINT) |
8295 | printf("\nWAITING_TID_QUEUES:\n"); | 8291 | printk("\nWAITING_TID_QUEUES:\n"); |
8296 | 8292 | ||
8297 | /* | 8293 | /* |
8298 | * Search waiting for selection lists. We traverse the | 8294 | * Search waiting for selection lists. We traverse the |
@@ -8320,7 +8316,7 @@ ahd_search_qinfifo(struct ahd_softc *ahd, int target, char channel, | |||
8320 | panic("TID LIST LOOP"); | 8316 | panic("TID LIST LOOP"); |
8321 | 8317 | ||
8322 | if (scbid >= ahd->scb_data.numscbs) { | 8318 | if (scbid >= ahd->scb_data.numscbs) { |
8323 | printf("%s: Waiting TID List inconsistency. " | 8319 | printk("%s: Waiting TID List inconsistency. " |
8324 | "SCB index == 0x%x, yet numscbs == 0x%x.", | 8320 | "SCB index == 0x%x, yet numscbs == 0x%x.", |
8325 | ahd_name(ahd), scbid, ahd->scb_data.numscbs); | 8321 | ahd_name(ahd), scbid, ahd->scb_data.numscbs); |
8326 | ahd_dump_card_state(ahd); | 8322 | ahd_dump_card_state(ahd); |
@@ -8328,7 +8324,7 @@ ahd_search_qinfifo(struct ahd_softc *ahd, int target, char channel, | |||
8328 | } | 8324 | } |
8329 | scb = ahd_lookup_scb(ahd, scbid); | 8325 | scb = ahd_lookup_scb(ahd, scbid); |
8330 | if (scb == NULL) { | 8326 | if (scb == NULL) { |
8331 | printf("%s: SCB = 0x%x Not Active!\n", | 8327 | printk("%s: SCB = 0x%x Not Active!\n", |
8332 | ahd_name(ahd), scbid); | 8328 | ahd_name(ahd), scbid); |
8333 | panic("Waiting TID List traversal\n"); | 8329 | panic("Waiting TID List traversal\n"); |
8334 | } | 8330 | } |
@@ -8344,7 +8340,7 @@ ahd_search_qinfifo(struct ahd_softc *ahd, int target, char channel, | |||
8344 | * We found a list of scbs that needs to be searched. | 8340 | * We found a list of scbs that needs to be searched. |
8345 | */ | 8341 | */ |
8346 | if (action == SEARCH_PRINT) | 8342 | if (action == SEARCH_PRINT) |
8347 | printf(" %d ( ", SCB_GET_TARGET(ahd, scb)); | 8343 | printk(" %d ( ", SCB_GET_TARGET(ahd, scb)); |
8348 | tid_head = scbid; | 8344 | tid_head = scbid; |
8349 | found += ahd_search_scb_list(ahd, target, channel, | 8345 | found += ahd_search_scb_list(ahd, target, channel, |
8350 | lun, tag, role, status, | 8346 | lun, tag, role, status, |
@@ -8365,14 +8361,14 @@ ahd_search_qinfifo(struct ahd_softc *ahd, int target, char channel, | |||
8365 | switch (action) { | 8361 | switch (action) { |
8366 | case SEARCH_COMPLETE: | 8362 | case SEARCH_COMPLETE: |
8367 | if ((mk_msg_scb->flags & SCB_ACTIVE) == 0) | 8363 | if ((mk_msg_scb->flags & SCB_ACTIVE) == 0) |
8368 | printf("Inactive SCB pending MK_MSG\n"); | 8364 | printk("Inactive SCB pending MK_MSG\n"); |
8369 | ahd_done_with_status(ahd, mk_msg_scb, status); | 8365 | ahd_done_with_status(ahd, mk_msg_scb, status); |
8370 | /* FALLTHROUGH */ | 8366 | /* FALLTHROUGH */ |
8371 | case SEARCH_REMOVE: | 8367 | case SEARCH_REMOVE: |
8372 | { | 8368 | { |
8373 | u_int tail_offset; | 8369 | u_int tail_offset; |
8374 | 8370 | ||
8375 | printf("Removing MK_MSG scb\n"); | 8371 | printk("Removing MK_MSG scb\n"); |
8376 | 8372 | ||
8377 | /* | 8373 | /* |
8378 | * Reset our tail to the tail of the | 8374 | * Reset our tail to the tail of the |
@@ -8390,7 +8386,7 @@ ahd_search_qinfifo(struct ahd_softc *ahd, int target, char channel, | |||
8390 | break; | 8386 | break; |
8391 | } | 8387 | } |
8392 | case SEARCH_PRINT: | 8388 | case SEARCH_PRINT: |
8393 | printf(" 0x%x", SCB_GET_TAG(scb)); | 8389 | printk(" 0x%x", SCB_GET_TAG(scb)); |
8394 | /* FALLTHROUGH */ | 8390 | /* FALLTHROUGH */ |
8395 | case SEARCH_COUNT: | 8391 | case SEARCH_COUNT: |
8396 | break; | 8392 | break; |
@@ -8407,7 +8403,7 @@ ahd_search_qinfifo(struct ahd_softc *ahd, int target, char channel, | |||
8407 | * queue with a pending MK_MESSAGE scb, we | 8403 | * queue with a pending MK_MESSAGE scb, we |
8408 | * must queue the MK_MESSAGE scb. | 8404 | * must queue the MK_MESSAGE scb. |
8409 | */ | 8405 | */ |
8410 | printf("Queueing mk_msg_scb\n"); | 8406 | printk("Queueing mk_msg_scb\n"); |
8411 | tid_head = ahd_inw(ahd, MK_MESSAGE_SCB); | 8407 | tid_head = ahd_inw(ahd, MK_MESSAGE_SCB); |
8412 | seq_flags2 &= ~PENDING_MK_MESSAGE; | 8408 | seq_flags2 &= ~PENDING_MK_MESSAGE; |
8413 | ahd_outb(ahd, SEQ_FLAGS2, seq_flags2); | 8409 | ahd_outb(ahd, SEQ_FLAGS2, seq_flags2); |
@@ -8418,7 +8414,7 @@ ahd_search_qinfifo(struct ahd_softc *ahd, int target, char channel, | |||
8418 | if (!SCBID_IS_NULL(tid_head)) | 8414 | if (!SCBID_IS_NULL(tid_head)) |
8419 | tid_prev = tid_head; | 8415 | tid_prev = tid_head; |
8420 | if (action == SEARCH_PRINT) | 8416 | if (action == SEARCH_PRINT) |
8421 | printf(")\n"); | 8417 | printk(")\n"); |
8422 | } | 8418 | } |
8423 | 8419 | ||
8424 | /* Restore saved state. */ | 8420 | /* Restore saved state. */ |
@@ -8446,7 +8442,7 @@ ahd_search_scb_list(struct ahd_softc *ahd, int target, char channel, | |||
8446 | *list_tail = SCB_LIST_NULL; | 8442 | *list_tail = SCB_LIST_NULL; |
8447 | for (scbid = next; !SCBID_IS_NULL(scbid); scbid = next) { | 8443 | for (scbid = next; !SCBID_IS_NULL(scbid); scbid = next) { |
8448 | if (scbid >= ahd->scb_data.numscbs) { | 8444 | if (scbid >= ahd->scb_data.numscbs) { |
8449 | printf("%s:SCB List inconsistency. " | 8445 | printk("%s:SCB List inconsistency. " |
8450 | "SCB == 0x%x, yet numscbs == 0x%x.", | 8446 | "SCB == 0x%x, yet numscbs == 0x%x.", |
8451 | ahd_name(ahd), scbid, ahd->scb_data.numscbs); | 8447 | ahd_name(ahd), scbid, ahd->scb_data.numscbs); |
8452 | ahd_dump_card_state(ahd); | 8448 | ahd_dump_card_state(ahd); |
@@ -8454,7 +8450,7 @@ ahd_search_scb_list(struct ahd_softc *ahd, int target, char channel, | |||
8454 | } | 8450 | } |
8455 | scb = ahd_lookup_scb(ahd, scbid); | 8451 | scb = ahd_lookup_scb(ahd, scbid); |
8456 | if (scb == NULL) { | 8452 | if (scb == NULL) { |
8457 | printf("%s: SCB = %d Not Active!\n", | 8453 | printk("%s: SCB = %d Not Active!\n", |
8458 | ahd_name(ahd), scbid); | 8454 | ahd_name(ahd), scbid); |
8459 | panic("Waiting List traversal\n"); | 8455 | panic("Waiting List traversal\n"); |
8460 | } | 8456 | } |
@@ -8470,7 +8466,7 @@ ahd_search_scb_list(struct ahd_softc *ahd, int target, char channel, | |||
8470 | switch (action) { | 8466 | switch (action) { |
8471 | case SEARCH_COMPLETE: | 8467 | case SEARCH_COMPLETE: |
8472 | if ((scb->flags & SCB_ACTIVE) == 0) | 8468 | if ((scb->flags & SCB_ACTIVE) == 0) |
8473 | printf("Inactive SCB in Waiting List\n"); | 8469 | printk("Inactive SCB in Waiting List\n"); |
8474 | ahd_done_with_status(ahd, scb, status); | 8470 | ahd_done_with_status(ahd, scb, status); |
8475 | /* FALLTHROUGH */ | 8471 | /* FALLTHROUGH */ |
8476 | case SEARCH_REMOVE: | 8472 | case SEARCH_REMOVE: |
@@ -8480,7 +8476,7 @@ ahd_search_scb_list(struct ahd_softc *ahd, int target, char channel, | |||
8480 | *list_head = next; | 8476 | *list_head = next; |
8481 | break; | 8477 | break; |
8482 | case SEARCH_PRINT: | 8478 | case SEARCH_PRINT: |
8483 | printf("0x%x ", scbid); | 8479 | printk("0x%x ", scbid); |
8484 | case SEARCH_COUNT: | 8480 | case SEARCH_COUNT: |
8485 | prev = scbid; | 8481 | prev = scbid; |
8486 | break; | 8482 | break; |
@@ -8668,7 +8664,7 @@ ahd_abort_scbs(struct ahd_softc *ahd, int target, char channel, | |||
8668 | if (ahd_get_transaction_status(scbp) != CAM_REQ_CMP) | 8664 | if (ahd_get_transaction_status(scbp) != CAM_REQ_CMP) |
8669 | ahd_freeze_scb(scbp); | 8665 | ahd_freeze_scb(scbp); |
8670 | if ((scbp->flags & SCB_ACTIVE) == 0) | 8666 | if ((scbp->flags & SCB_ACTIVE) == 0) |
8671 | printf("Inactive SCB on pending list\n"); | 8667 | printk("Inactive SCB on pending list\n"); |
8672 | ahd_done(ahd, scbp); | 8668 | ahd_done(ahd, scbp); |
8673 | found++; | 8669 | found++; |
8674 | } | 8670 | } |
@@ -8725,7 +8721,7 @@ ahd_reset_channel(struct ahd_softc *ahd, char channel, int initiate_reset) | |||
8725 | * Check if the last bus reset is cleared | 8721 | * Check if the last bus reset is cleared |
8726 | */ | 8722 | */ |
8727 | if (ahd->flags & AHD_BUS_RESET_ACTIVE) { | 8723 | if (ahd->flags & AHD_BUS_RESET_ACTIVE) { |
8728 | printf("%s: bus reset still active\n", | 8724 | printk("%s: bus reset still active\n", |
8729 | ahd_name(ahd)); | 8725 | ahd_name(ahd)); |
8730 | return 0; | 8726 | return 0; |
8731 | } | 8727 | } |
@@ -8900,7 +8896,7 @@ ahd_stat_timer(void *arg) | |||
8900 | ahd_enable_coalescing(ahd, enint_coal); | 8896 | ahd_enable_coalescing(ahd, enint_coal); |
8901 | #ifdef AHD_DEBUG | 8897 | #ifdef AHD_DEBUG |
8902 | if ((ahd_debug & AHD_SHOW_INT_COALESCING) != 0) | 8898 | if ((ahd_debug & AHD_SHOW_INT_COALESCING) != 0) |
8903 | printf("%s: Interrupt coalescing " | 8899 | printk("%s: Interrupt coalescing " |
8904 | "now %sabled. Cmds %d\n", | 8900 | "now %sabled. Cmds %d\n", |
8905 | ahd_name(ahd), | 8901 | ahd_name(ahd), |
8906 | (enint_coal & ENINT_COALESCE) ? "en" : "dis", | 8902 | (enint_coal & ENINT_COALESCE) ? "en" : "dis", |
@@ -8975,9 +8971,9 @@ ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb) | |||
8975 | #ifdef AHD_DEBUG | 8971 | #ifdef AHD_DEBUG |
8976 | if ((ahd_debug & AHD_SHOW_SENSE) != 0) { | 8972 | if ((ahd_debug & AHD_SHOW_SENSE) != 0) { |
8977 | ahd_print_path(ahd, scb); | 8973 | ahd_print_path(ahd, scb); |
8978 | printf("SCB 0x%x Received PKT Status of 0x%x\n", | 8974 | printk("SCB 0x%x Received PKT Status of 0x%x\n", |
8979 | SCB_GET_TAG(scb), siu->status); | 8975 | SCB_GET_TAG(scb), siu->status); |
8980 | printf("\tflags = 0x%x, sense len = 0x%x, " | 8976 | printk("\tflags = 0x%x, sense len = 0x%x, " |
8981 | "pktfail = 0x%x\n", | 8977 | "pktfail = 0x%x\n", |
8982 | siu->flags, scsi_4btoul(siu->sense_length), | 8978 | siu->flags, scsi_4btoul(siu->sense_length), |
8983 | scsi_4btoul(siu->pkt_failures_length)); | 8979 | scsi_4btoul(siu->pkt_failures_length)); |
@@ -8986,27 +8982,27 @@ ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb) | |||
8986 | if ((siu->flags & SIU_RSPVALID) != 0) { | 8982 | if ((siu->flags & SIU_RSPVALID) != 0) { |
8987 | ahd_print_path(ahd, scb); | 8983 | ahd_print_path(ahd, scb); |
8988 | if (scsi_4btoul(siu->pkt_failures_length) < 4) { | 8984 | if (scsi_4btoul(siu->pkt_failures_length) < 4) { |
8989 | printf("Unable to parse pkt_failures\n"); | 8985 | printk("Unable to parse pkt_failures\n"); |
8990 | } else { | 8986 | } else { |
8991 | 8987 | ||
8992 | switch (SIU_PKTFAIL_CODE(siu)) { | 8988 | switch (SIU_PKTFAIL_CODE(siu)) { |
8993 | case SIU_PFC_NONE: | 8989 | case SIU_PFC_NONE: |
8994 | printf("No packet failure found\n"); | 8990 | printk("No packet failure found\n"); |
8995 | break; | 8991 | break; |
8996 | case SIU_PFC_CIU_FIELDS_INVALID: | 8992 | case SIU_PFC_CIU_FIELDS_INVALID: |
8997 | printf("Invalid Command IU Field\n"); | 8993 | printk("Invalid Command IU Field\n"); |
8998 | break; | 8994 | break; |
8999 | case SIU_PFC_TMF_NOT_SUPPORTED: | 8995 | case SIU_PFC_TMF_NOT_SUPPORTED: |
9000 | printf("TMF not supportd\n"); | 8996 | printk("TMF not supportd\n"); |
9001 | break; | 8997 | break; |
9002 | case SIU_PFC_TMF_FAILED: | 8998 | case SIU_PFC_TMF_FAILED: |
9003 | printf("TMF failed\n"); | 8999 | printk("TMF failed\n"); |
9004 | break; | 9000 | break; |
9005 | case SIU_PFC_INVALID_TYPE_CODE: | 9001 | case SIU_PFC_INVALID_TYPE_CODE: |
9006 | printf("Invalid L_Q Type code\n"); | 9002 | printk("Invalid L_Q Type code\n"); |
9007 | break; | 9003 | break; |
9008 | case SIU_PFC_ILLEGAL_REQUEST: | 9004 | case SIU_PFC_ILLEGAL_REQUEST: |
9009 | printf("Illegal request\n"); | 9005 | printk("Illegal request\n"); |
9010 | default: | 9006 | default: |
9011 | break; | 9007 | break; |
9012 | } | 9008 | } |
@@ -9019,7 +9015,7 @@ ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb) | |||
9019 | scb->flags |= SCB_PKT_SENSE; | 9015 | scb->flags |= SCB_PKT_SENSE; |
9020 | #ifdef AHD_DEBUG | 9016 | #ifdef AHD_DEBUG |
9021 | if ((ahd_debug & AHD_SHOW_SENSE) != 0) | 9017 | if ((ahd_debug & AHD_SHOW_SENSE) != 0) |
9022 | printf("Sense data available\n"); | 9018 | printk("Sense data available\n"); |
9023 | #endif | 9019 | #endif |
9024 | } | 9020 | } |
9025 | ahd_done(ahd, scb); | 9021 | ahd_done(ahd, scb); |
@@ -9037,7 +9033,7 @@ ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb) | |||
9037 | #ifdef AHD_DEBUG | 9033 | #ifdef AHD_DEBUG |
9038 | if (ahd_debug & AHD_SHOW_SENSE) { | 9034 | if (ahd_debug & AHD_SHOW_SENSE) { |
9039 | ahd_print_path(ahd, scb); | 9035 | ahd_print_path(ahd, scb); |
9040 | printf("SCB %d: requests Check Status\n", | 9036 | printk("SCB %d: requests Check Status\n", |
9041 | SCB_GET_TAG(scb)); | 9037 | SCB_GET_TAG(scb)); |
9042 | } | 9038 | } |
9043 | #endif | 9039 | #endif |
@@ -9065,7 +9061,7 @@ ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb) | |||
9065 | #ifdef AHD_DEBUG | 9061 | #ifdef AHD_DEBUG |
9066 | if (ahd_debug & AHD_SHOW_SENSE) { | 9062 | if (ahd_debug & AHD_SHOW_SENSE) { |
9067 | ahd_print_path(ahd, scb); | 9063 | ahd_print_path(ahd, scb); |
9068 | printf("Sending Sense\n"); | 9064 | printk("Sending Sense\n"); |
9069 | } | 9065 | } |
9070 | #endif | 9066 | #endif |
9071 | scb->sg_count = 0; | 9067 | scb->sg_count = 0; |
@@ -9117,7 +9113,7 @@ ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb) | |||
9117 | break; | 9113 | break; |
9118 | } | 9114 | } |
9119 | case SCSI_STATUS_OK: | 9115 | case SCSI_STATUS_OK: |
9120 | printf("%s: Interrupted for staus of 0???\n", | 9116 | printk("%s: Interrupted for staus of 0???\n", |
9121 | ahd_name(ahd)); | 9117 | ahd_name(ahd)); |
9122 | /* FALLTHROUGH */ | 9118 | /* FALLTHROUGH */ |
9123 | default: | 9119 | default: |
@@ -9192,7 +9188,7 @@ ahd_calc_residual(struct ahd_softc *ahd, struct scb *scb) | |||
9192 | return; | 9188 | return; |
9193 | } else if ((resid_sgptr & SG_OVERRUN_RESID) != 0) { | 9189 | } else if ((resid_sgptr & SG_OVERRUN_RESID) != 0) { |
9194 | ahd_print_path(ahd, scb); | 9190 | ahd_print_path(ahd, scb); |
9195 | printf("data overrun detected Tag == 0x%x.\n", | 9191 | printk("data overrun detected Tag == 0x%x.\n", |
9196 | SCB_GET_TAG(scb)); | 9192 | SCB_GET_TAG(scb)); |
9197 | ahd_freeze_devq(ahd, scb); | 9193 | ahd_freeze_devq(ahd, scb); |
9198 | ahd_set_transaction_status(scb, CAM_DATA_RUN_ERR); | 9194 | ahd_set_transaction_status(scb, CAM_DATA_RUN_ERR); |
@@ -9232,7 +9228,7 @@ ahd_calc_residual(struct ahd_softc *ahd, struct scb *scb) | |||
9232 | #ifdef AHD_DEBUG | 9228 | #ifdef AHD_DEBUG |
9233 | if ((ahd_debug & AHD_SHOW_MISC) != 0) { | 9229 | if ((ahd_debug & AHD_SHOW_MISC) != 0) { |
9234 | ahd_print_path(ahd, scb); | 9230 | ahd_print_path(ahd, scb); |
9235 | printf("Handled %sResidual of %d bytes\n", | 9231 | printk("Handled %sResidual of %d bytes\n", |
9236 | (scb->flags & SCB_SENSE) ? "Sense " : "", resid); | 9232 | (scb->flags & SCB_SENSE) ? "Sense " : "", resid); |
9237 | } | 9233 | } |
9238 | #endif | 9234 | #endif |
@@ -9272,7 +9268,7 @@ ahd_queue_lstate_event(struct ahd_softc *ahd, struct ahd_tmode_lstate *lstate, | |||
9272 | 9268 | ||
9273 | if (pending == AHD_TMODE_EVENT_BUFFER_SIZE) { | 9269 | if (pending == AHD_TMODE_EVENT_BUFFER_SIZE) { |
9274 | xpt_print_path(lstate->path); | 9270 | xpt_print_path(lstate->path); |
9275 | printf("immediate event %x:%x lost\n", | 9271 | printk("immediate event %x:%x lost\n", |
9276 | lstate->event_buffer[lstate->event_r_idx].event_type, | 9272 | lstate->event_buffer[lstate->event_r_idx].event_type, |
9277 | lstate->event_buffer[lstate->event_r_idx].event_arg); | 9273 | lstate->event_buffer[lstate->event_r_idx].event_arg); |
9278 | lstate->event_r_idx++; | 9274 | lstate->event_r_idx++; |
@@ -9344,7 +9340,7 @@ ahd_dumpseq(struct ahd_softc* ahd) | |||
9344 | uint8_t ins_bytes[4]; | 9340 | uint8_t ins_bytes[4]; |
9345 | 9341 | ||
9346 | ahd_insb(ahd, SEQRAM, ins_bytes, 4); | 9342 | ahd_insb(ahd, SEQRAM, ins_bytes, 4); |
9347 | printf("0x%08x\n", ins_bytes[0] << 24 | 9343 | printk("0x%08x\n", ins_bytes[0] << 24 |
9348 | | ins_bytes[1] << 16 | 9344 | | ins_bytes[1] << 16 |
9349 | | ins_bytes[2] << 8 | 9345 | | ins_bytes[2] << 8 |
9350 | | ins_bytes[3]); | 9346 | | ins_bytes[3]); |
@@ -9372,7 +9368,7 @@ ahd_loadseq(struct ahd_softc *ahd) | |||
9372 | uint8_t download_consts[DOWNLOAD_CONST_COUNT]; | 9368 | uint8_t download_consts[DOWNLOAD_CONST_COUNT]; |
9373 | 9369 | ||
9374 | if (bootverbose) | 9370 | if (bootverbose) |
9375 | printf("%s: Downloading Sequencer Program...", | 9371 | printk("%s: Downloading Sequencer Program...", |
9376 | ahd_name(ahd)); | 9372 | ahd_name(ahd)); |
9377 | 9373 | ||
9378 | #if DOWNLOAD_CONST_COUNT != 8 | 9374 | #if DOWNLOAD_CONST_COUNT != 8 |
@@ -9498,7 +9494,7 @@ ahd_loadseq(struct ahd_softc *ahd) | |||
9498 | if (cs_count != 0) { | 9494 | if (cs_count != 0) { |
9499 | 9495 | ||
9500 | cs_count *= sizeof(struct cs); | 9496 | cs_count *= sizeof(struct cs); |
9501 | ahd->critical_sections = malloc(cs_count, M_DEVBUF, M_NOWAIT); | 9497 | ahd->critical_sections = kmalloc(cs_count, GFP_ATOMIC); |
9502 | if (ahd->critical_sections == NULL) | 9498 | if (ahd->critical_sections == NULL) |
9503 | panic("ahd_loadseq: Could not malloc"); | 9499 | panic("ahd_loadseq: Could not malloc"); |
9504 | memcpy(ahd->critical_sections, cs_table, cs_count); | 9500 | memcpy(ahd->critical_sections, cs_table, cs_count); |
@@ -9506,8 +9502,8 @@ ahd_loadseq(struct ahd_softc *ahd) | |||
9506 | ahd_outb(ahd, SEQCTL0, PERRORDIS|FAILDIS|FASTMODE); | 9502 | ahd_outb(ahd, SEQCTL0, PERRORDIS|FAILDIS|FASTMODE); |
9507 | 9503 | ||
9508 | if (bootverbose) { | 9504 | if (bootverbose) { |
9509 | printf(" %d instructions downloaded\n", downloaded); | 9505 | printk(" %d instructions downloaded\n", downloaded); |
9510 | printf("%s: Features 0x%x, Bugs 0x%x, Flags 0x%x\n", | 9506 | printk("%s: Features 0x%x, Bugs 0x%x, Flags 0x%x\n", |
9511 | ahd_name(ahd), ahd->features, ahd->bugs, ahd->flags); | 9507 | ahd_name(ahd), ahd->features, ahd->bugs, ahd->flags); |
9512 | } | 9508 | } |
9513 | } | 9509 | } |
@@ -9690,12 +9686,12 @@ ahd_print_register(const ahd_reg_parse_entry_t *table, u_int num_entries, | |||
9690 | u_int printed_mask; | 9686 | u_int printed_mask; |
9691 | 9687 | ||
9692 | if (cur_column != NULL && *cur_column >= wrap_point) { | 9688 | if (cur_column != NULL && *cur_column >= wrap_point) { |
9693 | printf("\n"); | 9689 | printk("\n"); |
9694 | *cur_column = 0; | 9690 | *cur_column = 0; |
9695 | } | 9691 | } |
9696 | printed = printf("%s[0x%x]", name, value); | 9692 | printed = printk("%s[0x%x]", name, value); |
9697 | if (table == NULL) { | 9693 | if (table == NULL) { |
9698 | printed += printf(" "); | 9694 | printed += printk(" "); |
9699 | *cur_column += printed; | 9695 | *cur_column += printed; |
9700 | return (printed); | 9696 | return (printed); |
9701 | } | 9697 | } |
@@ -9710,7 +9706,7 @@ ahd_print_register(const ahd_reg_parse_entry_t *table, u_int num_entries, | |||
9710 | == table[entry].mask)) | 9706 | == table[entry].mask)) |
9711 | continue; | 9707 | continue; |
9712 | 9708 | ||
9713 | printed += printf("%s%s", | 9709 | printed += printk("%s%s", |
9714 | printed_mask == 0 ? ":(" : "|", | 9710 | printed_mask == 0 ? ":(" : "|", |
9715 | table[entry].name); | 9711 | table[entry].name); |
9716 | printed_mask |= table[entry].mask; | 9712 | printed_mask |= table[entry].mask; |
@@ -9721,9 +9717,9 @@ ahd_print_register(const ahd_reg_parse_entry_t *table, u_int num_entries, | |||
9721 | break; | 9717 | break; |
9722 | } | 9718 | } |
9723 | if (printed_mask != 0) | 9719 | if (printed_mask != 0) |
9724 | printed += printf(") "); | 9720 | printed += printk(") "); |
9725 | else | 9721 | else |
9726 | printed += printf(" "); | 9722 | printed += printk(" "); |
9727 | if (cur_column != NULL) | 9723 | if (cur_column != NULL) |
9728 | *cur_column += printed; | 9724 | *cur_column += printed; |
9729 | return (printed); | 9725 | return (printed); |
@@ -9749,17 +9745,17 @@ ahd_dump_card_state(struct ahd_softc *ahd) | |||
9749 | } | 9745 | } |
9750 | saved_modes = ahd_save_modes(ahd); | 9746 | saved_modes = ahd_save_modes(ahd); |
9751 | ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); | 9747 | ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); |
9752 | printf(">>>>>>>>>>>>>>>>>> Dump Card State Begins <<<<<<<<<<<<<<<<<\n" | 9748 | printk(">>>>>>>>>>>>>>>>>> Dump Card State Begins <<<<<<<<<<<<<<<<<\n" |
9753 | "%s: Dumping Card State at program address 0x%x Mode 0x%x\n", | 9749 | "%s: Dumping Card State at program address 0x%x Mode 0x%x\n", |
9754 | ahd_name(ahd), | 9750 | ahd_name(ahd), |
9755 | ahd_inw(ahd, CURADDR), | 9751 | ahd_inw(ahd, CURADDR), |
9756 | ahd_build_mode_state(ahd, ahd->saved_src_mode, | 9752 | ahd_build_mode_state(ahd, ahd->saved_src_mode, |
9757 | ahd->saved_dst_mode)); | 9753 | ahd->saved_dst_mode)); |
9758 | if (paused) | 9754 | if (paused) |
9759 | printf("Card was paused\n"); | 9755 | printk("Card was paused\n"); |
9760 | 9756 | ||
9761 | if (ahd_check_cmdcmpltqueues(ahd)) | 9757 | if (ahd_check_cmdcmpltqueues(ahd)) |
9762 | printf("Completions are pending\n"); | 9758 | printk("Completions are pending\n"); |
9763 | 9759 | ||
9764 | /* | 9760 | /* |
9765 | * Mode independent registers. | 9761 | * Mode independent registers. |
@@ -9801,8 +9797,8 @@ ahd_dump_card_state(struct ahd_softc *ahd) | |||
9801 | ahd_lqostat0_print(ahd_inb(ahd, LQOSTAT0), &cur_col, 50); | 9797 | ahd_lqostat0_print(ahd_inb(ahd, LQOSTAT0), &cur_col, 50); |
9802 | ahd_lqostat1_print(ahd_inb(ahd, LQOSTAT1), &cur_col, 50); | 9798 | ahd_lqostat1_print(ahd_inb(ahd, LQOSTAT1), &cur_col, 50); |
9803 | ahd_lqostat2_print(ahd_inb(ahd, LQOSTAT2), &cur_col, 50); | 9799 | ahd_lqostat2_print(ahd_inb(ahd, LQOSTAT2), &cur_col, 50); |
9804 | printf("\n"); | 9800 | printk("\n"); |
9805 | printf("\nSCB Count = %d CMDS_PENDING = %d LASTSCB 0x%x " | 9801 | printk("\nSCB Count = %d CMDS_PENDING = %d LASTSCB 0x%x " |
9806 | "CURRSCB 0x%x NEXTSCB 0x%x\n", | 9802 | "CURRSCB 0x%x NEXTSCB 0x%x\n", |
9807 | ahd->scb_data.numscbs, ahd_inw(ahd, CMDS_PENDING), | 9803 | ahd->scb_data.numscbs, ahd_inw(ahd, CMDS_PENDING), |
9808 | ahd_inw(ahd, LASTSCB), ahd_inw(ahd, CURRSCB), | 9804 | ahd_inw(ahd, LASTSCB), ahd_inw(ahd, CURRSCB), |
@@ -9813,12 +9809,12 @@ ahd_dump_card_state(struct ahd_softc *ahd) | |||
9813 | CAM_LUN_WILDCARD, SCB_LIST_NULL, | 9809 | CAM_LUN_WILDCARD, SCB_LIST_NULL, |
9814 | ROLE_UNKNOWN, /*status*/0, SEARCH_PRINT); | 9810 | ROLE_UNKNOWN, /*status*/0, SEARCH_PRINT); |
9815 | saved_scb_index = ahd_get_scbptr(ahd); | 9811 | saved_scb_index = ahd_get_scbptr(ahd); |
9816 | printf("Pending list:"); | 9812 | printk("Pending list:"); |
9817 | i = 0; | 9813 | i = 0; |
9818 | LIST_FOREACH(scb, &ahd->pending_scbs, pending_links) { | 9814 | LIST_FOREACH(scb, &ahd->pending_scbs, pending_links) { |
9819 | if (i++ > AHD_SCB_MAX) | 9815 | if (i++ > AHD_SCB_MAX) |
9820 | break; | 9816 | break; |
9821 | cur_col = printf("\n%3d FIFO_USE[0x%x] ", SCB_GET_TAG(scb), | 9817 | cur_col = printk("\n%3d FIFO_USE[0x%x] ", SCB_GET_TAG(scb), |
9822 | ahd_inb_scbram(ahd, SCB_FIFO_USE_COUNT)); | 9818 | ahd_inb_scbram(ahd, SCB_FIFO_USE_COUNT)); |
9823 | ahd_set_scbptr(ahd, SCB_GET_TAG(scb)); | 9819 | ahd_set_scbptr(ahd, SCB_GET_TAG(scb)); |
9824 | ahd_scb_control_print(ahd_inb_scbram(ahd, SCB_CONTROL), | 9820 | ahd_scb_control_print(ahd_inb_scbram(ahd, SCB_CONTROL), |
@@ -9826,16 +9822,16 @@ ahd_dump_card_state(struct ahd_softc *ahd) | |||
9826 | ahd_scb_scsiid_print(ahd_inb_scbram(ahd, SCB_SCSIID), | 9822 | ahd_scb_scsiid_print(ahd_inb_scbram(ahd, SCB_SCSIID), |
9827 | &cur_col, 60); | 9823 | &cur_col, 60); |
9828 | } | 9824 | } |
9829 | printf("\nTotal %d\n", i); | 9825 | printk("\nTotal %d\n", i); |
9830 | 9826 | ||
9831 | printf("Kernel Free SCB list: "); | 9827 | printk("Kernel Free SCB list: "); |
9832 | i = 0; | 9828 | i = 0; |
9833 | TAILQ_FOREACH(scb, &ahd->scb_data.free_scbs, links.tqe) { | 9829 | TAILQ_FOREACH(scb, &ahd->scb_data.free_scbs, links.tqe) { |
9834 | struct scb *list_scb; | 9830 | struct scb *list_scb; |
9835 | 9831 | ||
9836 | list_scb = scb; | 9832 | list_scb = scb; |
9837 | do { | 9833 | do { |
9838 | printf("%d ", SCB_GET_TAG(list_scb)); | 9834 | printk("%d ", SCB_GET_TAG(list_scb)); |
9839 | list_scb = LIST_NEXT(list_scb, collision_links); | 9835 | list_scb = LIST_NEXT(list_scb, collision_links); |
9840 | } while (list_scb && i++ < AHD_SCB_MAX); | 9836 | } while (list_scb && i++ < AHD_SCB_MAX); |
9841 | } | 9837 | } |
@@ -9843,49 +9839,49 @@ ahd_dump_card_state(struct ahd_softc *ahd) | |||
9843 | LIST_FOREACH(scb, &ahd->scb_data.any_dev_free_scb_list, links.le) { | 9839 | LIST_FOREACH(scb, &ahd->scb_data.any_dev_free_scb_list, links.le) { |
9844 | if (i++ > AHD_SCB_MAX) | 9840 | if (i++ > AHD_SCB_MAX) |
9845 | break; | 9841 | break; |
9846 | printf("%d ", SCB_GET_TAG(scb)); | 9842 | printk("%d ", SCB_GET_TAG(scb)); |
9847 | } | 9843 | } |
9848 | printf("\n"); | 9844 | printk("\n"); |
9849 | 9845 | ||
9850 | printf("Sequencer Complete DMA-inprog list: "); | 9846 | printk("Sequencer Complete DMA-inprog list: "); |
9851 | scb_index = ahd_inw(ahd, COMPLETE_SCB_DMAINPROG_HEAD); | 9847 | scb_index = ahd_inw(ahd, COMPLETE_SCB_DMAINPROG_HEAD); |
9852 | i = 0; | 9848 | i = 0; |
9853 | while (!SCBID_IS_NULL(scb_index) && i++ < AHD_SCB_MAX) { | 9849 | while (!SCBID_IS_NULL(scb_index) && i++ < AHD_SCB_MAX) { |
9854 | ahd_set_scbptr(ahd, scb_index); | 9850 | ahd_set_scbptr(ahd, scb_index); |
9855 | printf("%d ", scb_index); | 9851 | printk("%d ", scb_index); |
9856 | scb_index = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE); | 9852 | scb_index = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE); |
9857 | } | 9853 | } |
9858 | printf("\n"); | 9854 | printk("\n"); |
9859 | 9855 | ||
9860 | printf("Sequencer Complete list: "); | 9856 | printk("Sequencer Complete list: "); |
9861 | scb_index = ahd_inw(ahd, COMPLETE_SCB_HEAD); | 9857 | scb_index = ahd_inw(ahd, COMPLETE_SCB_HEAD); |
9862 | i = 0; | 9858 | i = 0; |
9863 | while (!SCBID_IS_NULL(scb_index) && i++ < AHD_SCB_MAX) { | 9859 | while (!SCBID_IS_NULL(scb_index) && i++ < AHD_SCB_MAX) { |
9864 | ahd_set_scbptr(ahd, scb_index); | 9860 | ahd_set_scbptr(ahd, scb_index); |
9865 | printf("%d ", scb_index); | 9861 | printk("%d ", scb_index); |
9866 | scb_index = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE); | 9862 | scb_index = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE); |
9867 | } | 9863 | } |
9868 | printf("\n"); | 9864 | printk("\n"); |
9869 | 9865 | ||
9870 | 9866 | ||
9871 | printf("Sequencer DMA-Up and Complete list: "); | 9867 | printk("Sequencer DMA-Up and Complete list: "); |
9872 | scb_index = ahd_inw(ahd, COMPLETE_DMA_SCB_HEAD); | 9868 | scb_index = ahd_inw(ahd, COMPLETE_DMA_SCB_HEAD); |
9873 | i = 0; | 9869 | i = 0; |
9874 | while (!SCBID_IS_NULL(scb_index) && i++ < AHD_SCB_MAX) { | 9870 | while (!SCBID_IS_NULL(scb_index) && i++ < AHD_SCB_MAX) { |
9875 | ahd_set_scbptr(ahd, scb_index); | 9871 | ahd_set_scbptr(ahd, scb_index); |
9876 | printf("%d ", scb_index); | 9872 | printk("%d ", scb_index); |
9877 | scb_index = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE); | 9873 | scb_index = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE); |
9878 | } | 9874 | } |
9879 | printf("\n"); | 9875 | printk("\n"); |
9880 | printf("Sequencer On QFreeze and Complete list: "); | 9876 | printk("Sequencer On QFreeze and Complete list: "); |
9881 | scb_index = ahd_inw(ahd, COMPLETE_ON_QFREEZE_HEAD); | 9877 | scb_index = ahd_inw(ahd, COMPLETE_ON_QFREEZE_HEAD); |
9882 | i = 0; | 9878 | i = 0; |
9883 | while (!SCBID_IS_NULL(scb_index) && i++ < AHD_SCB_MAX) { | 9879 | while (!SCBID_IS_NULL(scb_index) && i++ < AHD_SCB_MAX) { |
9884 | ahd_set_scbptr(ahd, scb_index); | 9880 | ahd_set_scbptr(ahd, scb_index); |
9885 | printf("%d ", scb_index); | 9881 | printk("%d ", scb_index); |
9886 | scb_index = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE); | 9882 | scb_index = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE); |
9887 | } | 9883 | } |
9888 | printf("\n"); | 9884 | printk("\n"); |
9889 | ahd_set_scbptr(ahd, saved_scb_index); | 9885 | ahd_set_scbptr(ahd, saved_scb_index); |
9890 | dffstat = ahd_inb(ahd, DFFSTAT); | 9886 | dffstat = ahd_inb(ahd, DFFSTAT); |
9891 | for (i = 0; i < 2; i++) { | 9887 | for (i = 0; i < 2; i++) { |
@@ -9896,7 +9892,7 @@ ahd_dump_card_state(struct ahd_softc *ahd) | |||
9896 | 9892 | ||
9897 | ahd_set_modes(ahd, AHD_MODE_DFF0 + i, AHD_MODE_DFF0 + i); | 9893 | ahd_set_modes(ahd, AHD_MODE_DFF0 + i, AHD_MODE_DFF0 + i); |
9898 | fifo_scbptr = ahd_get_scbptr(ahd); | 9894 | fifo_scbptr = ahd_get_scbptr(ahd); |
9899 | printf("\n\n%s: FIFO%d %s, LONGJMP == 0x%x, SCB 0x%x\n", | 9895 | printk("\n\n%s: FIFO%d %s, LONGJMP == 0x%x, SCB 0x%x\n", |
9900 | ahd_name(ahd), i, | 9896 | ahd_name(ahd), i, |
9901 | (dffstat & (FIFO0FREE << i)) ? "Free" : "Active", | 9897 | (dffstat & (FIFO0FREE << i)) ? "Free" : "Active", |
9902 | ahd_inw(ahd, LONGJMP_ADDR), fifo_scbptr); | 9898 | ahd_inw(ahd, LONGJMP_ADDR), fifo_scbptr); |
@@ -9912,20 +9908,20 @@ ahd_dump_card_state(struct ahd_softc *ahd) | |||
9912 | ahd_soffcnt_print(ahd_inb(ahd, SOFFCNT), &cur_col, 50); | 9908 | ahd_soffcnt_print(ahd_inb(ahd, SOFFCNT), &cur_col, 50); |
9913 | ahd_mdffstat_print(ahd_inb(ahd, MDFFSTAT), &cur_col, 50); | 9909 | ahd_mdffstat_print(ahd_inb(ahd, MDFFSTAT), &cur_col, 50); |
9914 | if (cur_col > 50) { | 9910 | if (cur_col > 50) { |
9915 | printf("\n"); | 9911 | printk("\n"); |
9916 | cur_col = 0; | 9912 | cur_col = 0; |
9917 | } | 9913 | } |
9918 | cur_col += printf("SHADDR = 0x%x%x, SHCNT = 0x%x ", | 9914 | cur_col += printk("SHADDR = 0x%x%x, SHCNT = 0x%x ", |
9919 | ahd_inl(ahd, SHADDR+4), | 9915 | ahd_inl(ahd, SHADDR+4), |
9920 | ahd_inl(ahd, SHADDR), | 9916 | ahd_inl(ahd, SHADDR), |
9921 | (ahd_inb(ahd, SHCNT) | 9917 | (ahd_inb(ahd, SHCNT) |
9922 | | (ahd_inb(ahd, SHCNT + 1) << 8) | 9918 | | (ahd_inb(ahd, SHCNT + 1) << 8) |
9923 | | (ahd_inb(ahd, SHCNT + 2) << 16))); | 9919 | | (ahd_inb(ahd, SHCNT + 2) << 16))); |
9924 | if (cur_col > 50) { | 9920 | if (cur_col > 50) { |
9925 | printf("\n"); | 9921 | printk("\n"); |
9926 | cur_col = 0; | 9922 | cur_col = 0; |
9927 | } | 9923 | } |
9928 | cur_col += printf("HADDR = 0x%x%x, HCNT = 0x%x ", | 9924 | cur_col += printk("HADDR = 0x%x%x, HCNT = 0x%x ", |
9929 | ahd_inl(ahd, HADDR+4), | 9925 | ahd_inl(ahd, HADDR+4), |
9930 | ahd_inl(ahd, HADDR), | 9926 | ahd_inl(ahd, HADDR), |
9931 | (ahd_inb(ahd, HCNT) | 9927 | (ahd_inb(ahd, HCNT) |
@@ -9940,52 +9936,52 @@ ahd_dump_card_state(struct ahd_softc *ahd) | |||
9940 | } | 9936 | } |
9941 | #endif | 9937 | #endif |
9942 | } | 9938 | } |
9943 | printf("\nLQIN: "); | 9939 | printk("\nLQIN: "); |
9944 | for (i = 0; i < 20; i++) | 9940 | for (i = 0; i < 20; i++) |
9945 | printf("0x%x ", ahd_inb(ahd, LQIN + i)); | 9941 | printk("0x%x ", ahd_inb(ahd, LQIN + i)); |
9946 | printf("\n"); | 9942 | printk("\n"); |
9947 | ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG); | 9943 | ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG); |
9948 | printf("%s: LQISTATE = 0x%x, LQOSTATE = 0x%x, OPTIONMODE = 0x%x\n", | 9944 | printk("%s: LQISTATE = 0x%x, LQOSTATE = 0x%x, OPTIONMODE = 0x%x\n", |
9949 | ahd_name(ahd), ahd_inb(ahd, LQISTATE), ahd_inb(ahd, LQOSTATE), | 9945 | ahd_name(ahd), ahd_inb(ahd, LQISTATE), ahd_inb(ahd, LQOSTATE), |
9950 | ahd_inb(ahd, OPTIONMODE)); | 9946 | ahd_inb(ahd, OPTIONMODE)); |
9951 | printf("%s: OS_SPACE_CNT = 0x%x MAXCMDCNT = 0x%x\n", | 9947 | printk("%s: OS_SPACE_CNT = 0x%x MAXCMDCNT = 0x%x\n", |
9952 | ahd_name(ahd), ahd_inb(ahd, OS_SPACE_CNT), | 9948 | ahd_name(ahd), ahd_inb(ahd, OS_SPACE_CNT), |
9953 | ahd_inb(ahd, MAXCMDCNT)); | 9949 | ahd_inb(ahd, MAXCMDCNT)); |
9954 | printf("%s: SAVED_SCSIID = 0x%x SAVED_LUN = 0x%x\n", | 9950 | printk("%s: SAVED_SCSIID = 0x%x SAVED_LUN = 0x%x\n", |
9955 | ahd_name(ahd), ahd_inb(ahd, SAVED_SCSIID), | 9951 | ahd_name(ahd), ahd_inb(ahd, SAVED_SCSIID), |
9956 | ahd_inb(ahd, SAVED_LUN)); | 9952 | ahd_inb(ahd, SAVED_LUN)); |
9957 | ahd_simode0_print(ahd_inb(ahd, SIMODE0), &cur_col, 50); | 9953 | ahd_simode0_print(ahd_inb(ahd, SIMODE0), &cur_col, 50); |
9958 | printf("\n"); | 9954 | printk("\n"); |
9959 | ahd_set_modes(ahd, AHD_MODE_CCHAN, AHD_MODE_CCHAN); | 9955 | ahd_set_modes(ahd, AHD_MODE_CCHAN, AHD_MODE_CCHAN); |
9960 | cur_col = 0; | 9956 | cur_col = 0; |
9961 | ahd_ccscbctl_print(ahd_inb(ahd, CCSCBCTL), &cur_col, 50); | 9957 | ahd_ccscbctl_print(ahd_inb(ahd, CCSCBCTL), &cur_col, 50); |
9962 | printf("\n"); | 9958 | printk("\n"); |
9963 | ahd_set_modes(ahd, ahd->saved_src_mode, ahd->saved_dst_mode); | 9959 | ahd_set_modes(ahd, ahd->saved_src_mode, ahd->saved_dst_mode); |
9964 | printf("%s: REG0 == 0x%x, SINDEX = 0x%x, DINDEX = 0x%x\n", | 9960 | printk("%s: REG0 == 0x%x, SINDEX = 0x%x, DINDEX = 0x%x\n", |
9965 | ahd_name(ahd), ahd_inw(ahd, REG0), ahd_inw(ahd, SINDEX), | 9961 | ahd_name(ahd), ahd_inw(ahd, REG0), ahd_inw(ahd, SINDEX), |
9966 | ahd_inw(ahd, DINDEX)); | 9962 | ahd_inw(ahd, DINDEX)); |
9967 | printf("%s: SCBPTR == 0x%x, SCB_NEXT == 0x%x, SCB_NEXT2 == 0x%x\n", | 9963 | printk("%s: SCBPTR == 0x%x, SCB_NEXT == 0x%x, SCB_NEXT2 == 0x%x\n", |
9968 | ahd_name(ahd), ahd_get_scbptr(ahd), | 9964 | ahd_name(ahd), ahd_get_scbptr(ahd), |
9969 | ahd_inw_scbram(ahd, SCB_NEXT), | 9965 | ahd_inw_scbram(ahd, SCB_NEXT), |
9970 | ahd_inw_scbram(ahd, SCB_NEXT2)); | 9966 | ahd_inw_scbram(ahd, SCB_NEXT2)); |
9971 | printf("CDB %x %x %x %x %x %x\n", | 9967 | printk("CDB %x %x %x %x %x %x\n", |
9972 | ahd_inb_scbram(ahd, SCB_CDB_STORE), | 9968 | ahd_inb_scbram(ahd, SCB_CDB_STORE), |
9973 | ahd_inb_scbram(ahd, SCB_CDB_STORE+1), | 9969 | ahd_inb_scbram(ahd, SCB_CDB_STORE+1), |
9974 | ahd_inb_scbram(ahd, SCB_CDB_STORE+2), | 9970 | ahd_inb_scbram(ahd, SCB_CDB_STORE+2), |
9975 | ahd_inb_scbram(ahd, SCB_CDB_STORE+3), | 9971 | ahd_inb_scbram(ahd, SCB_CDB_STORE+3), |
9976 | ahd_inb_scbram(ahd, SCB_CDB_STORE+4), | 9972 | ahd_inb_scbram(ahd, SCB_CDB_STORE+4), |
9977 | ahd_inb_scbram(ahd, SCB_CDB_STORE+5)); | 9973 | ahd_inb_scbram(ahd, SCB_CDB_STORE+5)); |
9978 | printf("STACK:"); | 9974 | printk("STACK:"); |
9979 | for (i = 0; i < ahd->stack_size; i++) { | 9975 | for (i = 0; i < ahd->stack_size; i++) { |
9980 | ahd->saved_stack[i] = | 9976 | ahd->saved_stack[i] = |
9981 | ahd_inb(ahd, STACK)|(ahd_inb(ahd, STACK) << 8); | 9977 | ahd_inb(ahd, STACK)|(ahd_inb(ahd, STACK) << 8); |
9982 | printf(" 0x%x", ahd->saved_stack[i]); | 9978 | printk(" 0x%x", ahd->saved_stack[i]); |
9983 | } | 9979 | } |
9984 | for (i = ahd->stack_size-1; i >= 0; i--) { | 9980 | for (i = ahd->stack_size-1; i >= 0; i--) { |
9985 | ahd_outb(ahd, STACK, ahd->saved_stack[i] & 0xFF); | 9981 | ahd_outb(ahd, STACK, ahd->saved_stack[i] & 0xFF); |
9986 | ahd_outb(ahd, STACK, (ahd->saved_stack[i] >> 8) & 0xFF); | 9982 | ahd_outb(ahd, STACK, (ahd->saved_stack[i] >> 8) & 0xFF); |
9987 | } | 9983 | } |
9988 | printf("\n<<<<<<<<<<<<<<<<< Dump Card State Ends >>>>>>>>>>>>>>>>>>\n"); | 9984 | printk("\n<<<<<<<<<<<<<<<<< Dump Card State Ends >>>>>>>>>>>>>>>>>>\n"); |
9989 | ahd_restore_modes(ahd, saved_modes); | 9985 | ahd_restore_modes(ahd, saved_modes); |
9990 | if (paused == 0) | 9986 | if (paused == 0) |
9991 | ahd_unpause(ahd); | 9987 | ahd_unpause(ahd); |
@@ -10004,8 +10000,8 @@ ahd_dump_scbs(struct ahd_softc *ahd) | |||
10004 | saved_scb_index = ahd_get_scbptr(ahd); | 10000 | saved_scb_index = ahd_get_scbptr(ahd); |
10005 | for (i = 0; i < AHD_SCB_MAX; i++) { | 10001 | for (i = 0; i < AHD_SCB_MAX; i++) { |
10006 | ahd_set_scbptr(ahd, i); | 10002 | ahd_set_scbptr(ahd, i); |
10007 | printf("%3d", i); | 10003 | printk("%3d", i); |
10008 | printf("(CTRL 0x%x ID 0x%x N 0x%x N2 0x%x SG 0x%x, RSG 0x%x)\n", | 10004 | printk("(CTRL 0x%x ID 0x%x N 0x%x N2 0x%x SG 0x%x, RSG 0x%x)\n", |
10009 | ahd_inb_scbram(ahd, SCB_CONTROL), | 10005 | ahd_inb_scbram(ahd, SCB_CONTROL), |
10010 | ahd_inb_scbram(ahd, SCB_SCSIID), | 10006 | ahd_inb_scbram(ahd, SCB_SCSIID), |
10011 | ahd_inw_scbram(ahd, SCB_NEXT), | 10007 | ahd_inw_scbram(ahd, SCB_NEXT), |
@@ -10013,7 +10009,7 @@ ahd_dump_scbs(struct ahd_softc *ahd) | |||
10013 | ahd_inl_scbram(ahd, SCB_SGPTR), | 10009 | ahd_inl_scbram(ahd, SCB_SGPTR), |
10014 | ahd_inl_scbram(ahd, SCB_RESIDUAL_SGPTR)); | 10010 | ahd_inl_scbram(ahd, SCB_RESIDUAL_SGPTR)); |
10015 | } | 10011 | } |
10016 | printf("\n"); | 10012 | printk("\n"); |
10017 | ahd_set_scbptr(ahd, saved_scb_index); | 10013 | ahd_set_scbptr(ahd, saved_scb_index); |
10018 | ahd_restore_modes(ahd, saved_modes); | 10014 | ahd_restore_modes(ahd, saved_modes); |
10019 | } | 10015 | } |
@@ -10383,7 +10379,7 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb) | |||
10383 | && ccb->ccb_h.target_id != CAM_TARGET_WILDCARD) { | 10379 | && ccb->ccb_h.target_id != CAM_TARGET_WILDCARD) { |
10384 | u_long s; | 10380 | u_long s; |
10385 | 10381 | ||
10386 | printf("Configuring Target Mode\n"); | 10382 | printk("Configuring Target Mode\n"); |
10387 | ahd_lock(ahd, &s); | 10383 | ahd_lock(ahd, &s); |
10388 | if (LIST_FIRST(&ahd->pending_scbs) != NULL) { | 10384 | if (LIST_FIRST(&ahd->pending_scbs) != NULL) { |
10389 | ccb->ccb_h.status = CAM_BUSY; | 10385 | ccb->ccb_h.status = CAM_BUSY; |
@@ -10412,7 +10408,7 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb) | |||
10412 | /* Are we already enabled?? */ | 10408 | /* Are we already enabled?? */ |
10413 | if (lstate != NULL) { | 10409 | if (lstate != NULL) { |
10414 | xpt_print_path(ccb->ccb_h.path); | 10410 | xpt_print_path(ccb->ccb_h.path); |
10415 | printf("Lun already enabled\n"); | 10411 | printk("Lun already enabled\n"); |
10416 | ccb->ccb_h.status = CAM_LUN_ALRDY_ENA; | 10412 | ccb->ccb_h.status = CAM_LUN_ALRDY_ENA; |
10417 | return; | 10413 | return; |
10418 | } | 10414 | } |
@@ -10424,7 +10420,7 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb) | |||
10424 | * specific commands. | 10420 | * specific commands. |
10425 | */ | 10421 | */ |
10426 | ccb->ccb_h.status = CAM_REQ_INVALID; | 10422 | ccb->ccb_h.status = CAM_REQ_INVALID; |
10427 | printf("Non-zero Group Codes\n"); | 10423 | printk("Non-zero Group Codes\n"); |
10428 | return; | 10424 | return; |
10429 | } | 10425 | } |
10430 | 10426 | ||
@@ -10436,15 +10432,15 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb) | |||
10436 | tstate = ahd_alloc_tstate(ahd, target, channel); | 10432 | tstate = ahd_alloc_tstate(ahd, target, channel); |
10437 | if (tstate == NULL) { | 10433 | if (tstate == NULL) { |
10438 | xpt_print_path(ccb->ccb_h.path); | 10434 | xpt_print_path(ccb->ccb_h.path); |
10439 | printf("Couldn't allocate tstate\n"); | 10435 | printk("Couldn't allocate tstate\n"); |
10440 | ccb->ccb_h.status = CAM_RESRC_UNAVAIL; | 10436 | ccb->ccb_h.status = CAM_RESRC_UNAVAIL; |
10441 | return; | 10437 | return; |
10442 | } | 10438 | } |
10443 | } | 10439 | } |
10444 | lstate = malloc(sizeof(*lstate), M_DEVBUF, M_NOWAIT); | 10440 | lstate = kmalloc(sizeof(*lstate), GFP_ATOMIC); |
10445 | if (lstate == NULL) { | 10441 | if (lstate == NULL) { |
10446 | xpt_print_path(ccb->ccb_h.path); | 10442 | xpt_print_path(ccb->ccb_h.path); |
10447 | printf("Couldn't allocate lstate\n"); | 10443 | printk("Couldn't allocate lstate\n"); |
10448 | ccb->ccb_h.status = CAM_RESRC_UNAVAIL; | 10444 | ccb->ccb_h.status = CAM_RESRC_UNAVAIL; |
10449 | return; | 10445 | return; |
10450 | } | 10446 | } |
@@ -10454,9 +10450,9 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb) | |||
10454 | xpt_path_target_id(ccb->ccb_h.path), | 10450 | xpt_path_target_id(ccb->ccb_h.path), |
10455 | xpt_path_lun_id(ccb->ccb_h.path)); | 10451 | xpt_path_lun_id(ccb->ccb_h.path)); |
10456 | if (status != CAM_REQ_CMP) { | 10452 | if (status != CAM_REQ_CMP) { |
10457 | free(lstate, M_DEVBUF); | 10453 | kfree(lstate); |
10458 | xpt_print_path(ccb->ccb_h.path); | 10454 | xpt_print_path(ccb->ccb_h.path); |
10459 | printf("Couldn't allocate path\n"); | 10455 | printk("Couldn't allocate path\n"); |
10460 | ccb->ccb_h.status = CAM_RESRC_UNAVAIL; | 10456 | ccb->ccb_h.status = CAM_RESRC_UNAVAIL; |
10461 | return; | 10457 | return; |
10462 | } | 10458 | } |
@@ -10524,7 +10520,7 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb) | |||
10524 | ahd_unlock(ahd, &s); | 10520 | ahd_unlock(ahd, &s); |
10525 | ccb->ccb_h.status = CAM_REQ_CMP; | 10521 | ccb->ccb_h.status = CAM_REQ_CMP; |
10526 | xpt_print_path(ccb->ccb_h.path); | 10522 | xpt_print_path(ccb->ccb_h.path); |
10527 | printf("Lun now enabled for target mode\n"); | 10523 | printk("Lun now enabled for target mode\n"); |
10528 | } else { | 10524 | } else { |
10529 | struct scb *scb; | 10525 | struct scb *scb; |
10530 | int i, empty; | 10526 | int i, empty; |
@@ -10543,7 +10539,7 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb) | |||
10543 | ccbh = &scb->io_ctx->ccb_h; | 10539 | ccbh = &scb->io_ctx->ccb_h; |
10544 | if (ccbh->func_code == XPT_CONT_TARGET_IO | 10540 | if (ccbh->func_code == XPT_CONT_TARGET_IO |
10545 | && !xpt_path_comp(ccbh->path, ccb->ccb_h.path)){ | 10541 | && !xpt_path_comp(ccbh->path, ccb->ccb_h.path)){ |
10546 | printf("CTIO pending\n"); | 10542 | printk("CTIO pending\n"); |
10547 | ccb->ccb_h.status = CAM_REQ_INVALID; | 10543 | ccb->ccb_h.status = CAM_REQ_INVALID; |
10548 | ahd_unlock(ahd, &s); | 10544 | ahd_unlock(ahd, &s); |
10549 | return; | 10545 | return; |
@@ -10551,12 +10547,12 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb) | |||
10551 | } | 10547 | } |
10552 | 10548 | ||
10553 | if (SLIST_FIRST(&lstate->accept_tios) != NULL) { | 10549 | if (SLIST_FIRST(&lstate->accept_tios) != NULL) { |
10554 | printf("ATIOs pending\n"); | 10550 | printk("ATIOs pending\n"); |
10555 | ccb->ccb_h.status = CAM_REQ_INVALID; | 10551 | ccb->ccb_h.status = CAM_REQ_INVALID; |
10556 | } | 10552 | } |
10557 | 10553 | ||
10558 | if (SLIST_FIRST(&lstate->immed_notifies) != NULL) { | 10554 | if (SLIST_FIRST(&lstate->immed_notifies) != NULL) { |
10559 | printf("INOTs pending\n"); | 10555 | printk("INOTs pending\n"); |
10560 | ccb->ccb_h.status = CAM_REQ_INVALID; | 10556 | ccb->ccb_h.status = CAM_REQ_INVALID; |
10561 | } | 10557 | } |
10562 | 10558 | ||
@@ -10566,9 +10562,9 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb) | |||
10566 | } | 10562 | } |
10567 | 10563 | ||
10568 | xpt_print_path(ccb->ccb_h.path); | 10564 | xpt_print_path(ccb->ccb_h.path); |
10569 | printf("Target mode disabled\n"); | 10565 | printk("Target mode disabled\n"); |
10570 | xpt_free_path(lstate->path); | 10566 | xpt_free_path(lstate->path); |
10571 | free(lstate, M_DEVBUF); | 10567 | kfree(lstate); |
10572 | 10568 | ||
10573 | ahd_pause(ahd); | 10569 | ahd_pause(ahd); |
10574 | /* Can we clean up the target too? */ | 10570 | /* Can we clean up the target too? */ |
@@ -10615,7 +10611,7 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb) | |||
10615 | ahd_outb(ahd, SCSISEQ1, scsiseq1); | 10611 | ahd_outb(ahd, SCSISEQ1, scsiseq1); |
10616 | 10612 | ||
10617 | if ((ahd->features & AHD_MULTIROLE) == 0) { | 10613 | if ((ahd->features & AHD_MULTIROLE) == 0) { |
10618 | printf("Configuring Initiator Mode\n"); | 10614 | printk("Configuring Initiator Mode\n"); |
10619 | ahd->flags &= ~AHD_TARGETROLE; | 10615 | ahd->flags &= ~AHD_TARGETROLE; |
10620 | ahd->flags |= AHD_INITIATORROLE; | 10616 | ahd->flags |= AHD_INITIATORROLE; |
10621 | ahd_pause(ahd); | 10617 | ahd_pause(ahd); |
@@ -10749,7 +10745,7 @@ ahd_handle_target_cmd(struct ahd_softc *ahd, struct target_cmd *cmd) | |||
10749 | ahd->flags &= ~AHD_TQINFIFO_BLOCKED; | 10745 | ahd->flags &= ~AHD_TQINFIFO_BLOCKED; |
10750 | #ifdef AHD_DEBUG | 10746 | #ifdef AHD_DEBUG |
10751 | if ((ahd_debug & AHD_SHOW_TQIN) != 0) | 10747 | if ((ahd_debug & AHD_SHOW_TQIN) != 0) |
10752 | printf("Incoming command from %d for %d:%d%s\n", | 10748 | printk("Incoming command from %d for %d:%d%s\n", |
10753 | initiator, target, lun, | 10749 | initiator, target, lun, |
10754 | lstate == ahd->black_hole ? "(Black Holed)" : ""); | 10750 | lstate == ahd->black_hole ? "(Black Holed)" : ""); |
10755 | #endif | 10751 | #endif |
@@ -10796,7 +10792,7 @@ ahd_handle_target_cmd(struct ahd_softc *ahd, struct target_cmd *cmd) | |||
10796 | default: | 10792 | default: |
10797 | /* Only copy the opcode. */ | 10793 | /* Only copy the opcode. */ |
10798 | atio->cdb_len = 1; | 10794 | atio->cdb_len = 1; |
10799 | printf("Reserved or VU command code type encountered\n"); | 10795 | printk("Reserved or VU command code type encountered\n"); |
10800 | break; | 10796 | break; |
10801 | } | 10797 | } |
10802 | 10798 | ||
@@ -10813,7 +10809,7 @@ ahd_handle_target_cmd(struct ahd_softc *ahd, struct target_cmd *cmd) | |||
10813 | */ | 10809 | */ |
10814 | #ifdef AHD_DEBUG | 10810 | #ifdef AHD_DEBUG |
10815 | if ((ahd_debug & AHD_SHOW_TQIN) != 0) | 10811 | if ((ahd_debug & AHD_SHOW_TQIN) != 0) |
10816 | printf("Received Immediate Command %d:%d:%d - %p\n", | 10812 | printk("Received Immediate Command %d:%d:%d - %p\n", |
10817 | initiator, target, lun, ahd->pending_device); | 10813 | initiator, target, lun, ahd->pending_device); |
10818 | #endif | 10814 | #endif |
10819 | ahd->pending_device = lstate; | 10815 | ahd->pending_device = lstate; |
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c index 4c41332a354b..88ad8482ef59 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.c +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c | |||
@@ -674,7 +674,7 @@ ahd_linux_slave_alloc(struct scsi_device *sdev) | |||
674 | struct ahd_linux_device *dev; | 674 | struct ahd_linux_device *dev; |
675 | 675 | ||
676 | if (bootverbose) | 676 | if (bootverbose) |
677 | printf("%s: Slave Alloc %d\n", ahd_name(ahd), sdev->id); | 677 | printk("%s: Slave Alloc %d\n", ahd_name(ahd), sdev->id); |
678 | 678 | ||
679 | dev = scsi_transport_device_data(sdev); | 679 | dev = scsi_transport_device_data(sdev); |
680 | memset(dev, 0, sizeof(*dev)); | 680 | memset(dev, 0, sizeof(*dev)); |
@@ -798,10 +798,10 @@ ahd_linux_dev_reset(struct scsi_cmnd *cmd) | |||
798 | scmd_printk(KERN_INFO, cmd, | 798 | scmd_printk(KERN_INFO, cmd, |
799 | "Attempting to queue a TARGET RESET message:"); | 799 | "Attempting to queue a TARGET RESET message:"); |
800 | 800 | ||
801 | printf("CDB:"); | 801 | printk("CDB:"); |
802 | for (cdb_byte = 0; cdb_byte < cmd->cmd_len; cdb_byte++) | 802 | for (cdb_byte = 0; cdb_byte < cmd->cmd_len; cdb_byte++) |
803 | printf(" 0x%x", cmd->cmnd[cdb_byte]); | 803 | printk(" 0x%x", cmd->cmnd[cdb_byte]); |
804 | printf("\n"); | 804 | printk("\n"); |
805 | 805 | ||
806 | /* | 806 | /* |
807 | * Determine if we currently own this command. | 807 | * Determine if we currently own this command. |
@@ -857,16 +857,16 @@ ahd_linux_dev_reset(struct scsi_cmnd *cmd) | |||
857 | ahd->platform_data->eh_done = &done; | 857 | ahd->platform_data->eh_done = &done; |
858 | ahd_unlock(ahd, &flags); | 858 | ahd_unlock(ahd, &flags); |
859 | 859 | ||
860 | printf("%s: Device reset code sleeping\n", ahd_name(ahd)); | 860 | printk("%s: Device reset code sleeping\n", ahd_name(ahd)); |
861 | if (!wait_for_completion_timeout(&done, 5 * HZ)) { | 861 | if (!wait_for_completion_timeout(&done, 5 * HZ)) { |
862 | ahd_lock(ahd, &flags); | 862 | ahd_lock(ahd, &flags); |
863 | ahd->platform_data->eh_done = NULL; | 863 | ahd->platform_data->eh_done = NULL; |
864 | ahd_unlock(ahd, &flags); | 864 | ahd_unlock(ahd, &flags); |
865 | printf("%s: Device reset timer expired (active %d)\n", | 865 | printk("%s: Device reset timer expired (active %d)\n", |
866 | ahd_name(ahd), dev->active); | 866 | ahd_name(ahd), dev->active); |
867 | retval = FAILED; | 867 | retval = FAILED; |
868 | } | 868 | } |
869 | printf("%s: Device reset returning 0x%x\n", ahd_name(ahd), retval); | 869 | printk("%s: Device reset returning 0x%x\n", ahd_name(ahd), retval); |
870 | 870 | ||
871 | return (retval); | 871 | return (retval); |
872 | } | 872 | } |
@@ -884,7 +884,7 @@ ahd_linux_bus_reset(struct scsi_cmnd *cmd) | |||
884 | ahd = *(struct ahd_softc **)cmd->device->host->hostdata; | 884 | ahd = *(struct ahd_softc **)cmd->device->host->hostdata; |
885 | #ifdef AHD_DEBUG | 885 | #ifdef AHD_DEBUG |
886 | if ((ahd_debug & AHD_SHOW_RECOVERY) != 0) | 886 | if ((ahd_debug & AHD_SHOW_RECOVERY) != 0) |
887 | printf("%s: Bus reset called for cmd %p\n", | 887 | printk("%s: Bus reset called for cmd %p\n", |
888 | ahd_name(ahd), cmd); | 888 | ahd_name(ahd), cmd); |
889 | #endif | 889 | #endif |
890 | ahd_lock(ahd, &flags); | 890 | ahd_lock(ahd, &flags); |
@@ -894,7 +894,7 @@ ahd_linux_bus_reset(struct scsi_cmnd *cmd) | |||
894 | ahd_unlock(ahd, &flags); | 894 | ahd_unlock(ahd, &flags); |
895 | 895 | ||
896 | if (bootverbose) | 896 | if (bootverbose) |
897 | printf("%s: SCSI bus reset delivered. " | 897 | printk("%s: SCSI bus reset delivered. " |
898 | "%d SCBs aborted.\n", ahd_name(ahd), found); | 898 | "%d SCBs aborted.\n", ahd_name(ahd), found); |
899 | 899 | ||
900 | return (SUCCESS); | 900 | return (SUCCESS); |
@@ -935,7 +935,7 @@ ahd_dma_tag_create(struct ahd_softc *ahd, bus_dma_tag_t parent, | |||
935 | { | 935 | { |
936 | bus_dma_tag_t dmat; | 936 | bus_dma_tag_t dmat; |
937 | 937 | ||
938 | dmat = malloc(sizeof(*dmat), M_DEVBUF, M_NOWAIT); | 938 | dmat = kmalloc(sizeof(*dmat), GFP_ATOMIC); |
939 | if (dmat == NULL) | 939 | if (dmat == NULL) |
940 | return (ENOMEM); | 940 | return (ENOMEM); |
941 | 941 | ||
@@ -956,7 +956,7 @@ ahd_dma_tag_create(struct ahd_softc *ahd, bus_dma_tag_t parent, | |||
956 | void | 956 | void |
957 | ahd_dma_tag_destroy(struct ahd_softc *ahd, bus_dma_tag_t dmat) | 957 | ahd_dma_tag_destroy(struct ahd_softc *ahd, bus_dma_tag_t dmat) |
958 | { | 958 | { |
959 | free(dmat, M_DEVBUF); | 959 | kfree(dmat); |
960 | } | 960 | } |
961 | 961 | ||
962 | int | 962 | int |
@@ -1019,7 +1019,7 @@ ahd_linux_setup_iocell_info(u_long index, int instance, int targ, int32_t value) | |||
1019 | iocell_info = (uint8_t*)&aic79xx_iocell_info[instance]; | 1019 | iocell_info = (uint8_t*)&aic79xx_iocell_info[instance]; |
1020 | iocell_info[index] = value & 0xFFFF; | 1020 | iocell_info[index] = value & 0xFFFF; |
1021 | if (bootverbose) | 1021 | if (bootverbose) |
1022 | printf("iocell[%d:%ld] = %d\n", instance, index, value); | 1022 | printk("iocell[%d:%ld] = %d\n", instance, index, value); |
1023 | } | 1023 | } |
1024 | } | 1024 | } |
1025 | 1025 | ||
@@ -1029,7 +1029,7 @@ ahd_linux_setup_tag_info_global(char *p) | |||
1029 | int tags, i, j; | 1029 | int tags, i, j; |
1030 | 1030 | ||
1031 | tags = simple_strtoul(p + 1, NULL, 0) & 0xff; | 1031 | tags = simple_strtoul(p + 1, NULL, 0) & 0xff; |
1032 | printf("Setting Global Tags= %d\n", tags); | 1032 | printk("Setting Global Tags= %d\n", tags); |
1033 | 1033 | ||
1034 | for (i = 0; i < ARRAY_SIZE(aic79xx_tag_info); i++) { | 1034 | for (i = 0; i < ARRAY_SIZE(aic79xx_tag_info); i++) { |
1035 | for (j = 0; j < AHD_NUM_TARGETS; j++) { | 1035 | for (j = 0; j < AHD_NUM_TARGETS; j++) { |
@@ -1047,7 +1047,7 @@ ahd_linux_setup_tag_info(u_long arg, int instance, int targ, int32_t value) | |||
1047 | && (targ < AHD_NUM_TARGETS)) { | 1047 | && (targ < AHD_NUM_TARGETS)) { |
1048 | aic79xx_tag_info[instance].tag_commands[targ] = value & 0x1FF; | 1048 | aic79xx_tag_info[instance].tag_commands[targ] = value & 0x1FF; |
1049 | if (bootverbose) | 1049 | if (bootverbose) |
1050 | printf("tag_info[%d:%d] = %d\n", instance, targ, value); | 1050 | printk("tag_info[%d:%d] = %d\n", instance, targ, value); |
1051 | } | 1051 | } |
1052 | } | 1052 | } |
1053 | 1053 | ||
@@ -1088,7 +1088,7 @@ ahd_parse_brace_option(char *opt_name, char *opt_arg, char *end, int depth, | |||
1088 | if (targ == -1) | 1088 | if (targ == -1) |
1089 | targ = 0; | 1089 | targ = 0; |
1090 | } else { | 1090 | } else { |
1091 | printf("Malformed Option %s\n", | 1091 | printk("Malformed Option %s\n", |
1092 | opt_name); | 1092 | opt_name); |
1093 | done = TRUE; | 1093 | done = TRUE; |
1094 | } | 1094 | } |
@@ -1246,7 +1246,7 @@ ahd_linux_register_host(struct ahd_softc *ahd, struct scsi_host_template *templa | |||
1246 | ahd_set_unit(ahd, ahd_linux_unit++); | 1246 | ahd_set_unit(ahd, ahd_linux_unit++); |
1247 | ahd_unlock(ahd, &s); | 1247 | ahd_unlock(ahd, &s); |
1248 | sprintf(buf, "scsi%d", host->host_no); | 1248 | sprintf(buf, "scsi%d", host->host_no); |
1249 | new_name = malloc(strlen(buf) + 1, M_DEVBUF, M_NOWAIT); | 1249 | new_name = kmalloc(strlen(buf) + 1, GFP_ATOMIC); |
1250 | if (new_name != NULL) { | 1250 | if (new_name != NULL) { |
1251 | strcpy(new_name, buf); | 1251 | strcpy(new_name, buf); |
1252 | ahd_set_name(ahd, new_name); | 1252 | ahd_set_name(ahd, new_name); |
@@ -1322,7 +1322,7 @@ int | |||
1322 | ahd_platform_alloc(struct ahd_softc *ahd, void *platform_arg) | 1322 | ahd_platform_alloc(struct ahd_softc *ahd, void *platform_arg) |
1323 | { | 1323 | { |
1324 | ahd->platform_data = | 1324 | ahd->platform_data = |
1325 | malloc(sizeof(struct ahd_platform_data), M_DEVBUF, M_NOWAIT); | 1325 | kmalloc(sizeof(struct ahd_platform_data), GFP_ATOMIC); |
1326 | if (ahd->platform_data == NULL) | 1326 | if (ahd->platform_data == NULL) |
1327 | return (ENOMEM); | 1327 | return (ENOMEM); |
1328 | memset(ahd->platform_data, 0, sizeof(struct ahd_platform_data)); | 1328 | memset(ahd->platform_data, 0, sizeof(struct ahd_platform_data)); |
@@ -1364,7 +1364,7 @@ ahd_platform_free(struct ahd_softc *ahd) | |||
1364 | if (ahd->platform_data->host) | 1364 | if (ahd->platform_data->host) |
1365 | scsi_host_put(ahd->platform_data->host); | 1365 | scsi_host_put(ahd->platform_data->host); |
1366 | 1366 | ||
1367 | free(ahd->platform_data, M_DEVBUF); | 1367 | kfree(ahd->platform_data); |
1368 | } | 1368 | } |
1369 | } | 1369 | } |
1370 | 1370 | ||
@@ -1502,7 +1502,7 @@ ahd_linux_user_tagdepth(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) | |||
1502 | if (ahd->unit >= ARRAY_SIZE(aic79xx_tag_info)) { | 1502 | if (ahd->unit >= ARRAY_SIZE(aic79xx_tag_info)) { |
1503 | 1503 | ||
1504 | if (warned_user == 0) { | 1504 | if (warned_user == 0) { |
1505 | printf(KERN_WARNING | 1505 | printk(KERN_WARNING |
1506 | "aic79xx: WARNING: Insufficient tag_info instances\n" | 1506 | "aic79xx: WARNING: Insufficient tag_info instances\n" |
1507 | "aic79xx: for installed controllers. Using defaults\n" | 1507 | "aic79xx: for installed controllers. Using defaults\n" |
1508 | "aic79xx: Please update the aic79xx_tag_info array in\n" | 1508 | "aic79xx: Please update the aic79xx_tag_info array in\n" |
@@ -1544,7 +1544,7 @@ ahd_linux_device_queue_depth(struct scsi_device *sdev) | |||
1544 | ahd_send_async(ahd, devinfo.channel, devinfo.target, | 1544 | ahd_send_async(ahd, devinfo.channel, devinfo.target, |
1545 | devinfo.lun, AC_TRANSFER_NEG); | 1545 | devinfo.lun, AC_TRANSFER_NEG); |
1546 | ahd_print_devinfo(ahd, &devinfo); | 1546 | ahd_print_devinfo(ahd, &devinfo); |
1547 | printf("Tagged Queuing enabled. Depth %d\n", tags); | 1547 | printk("Tagged Queuing enabled. Depth %d\n", tags); |
1548 | } else { | 1548 | } else { |
1549 | ahd_platform_set_tags(ahd, sdev, &devinfo, AHD_QUEUE_NONE); | 1549 | ahd_platform_set_tags(ahd, sdev, &devinfo, AHD_QUEUE_NONE); |
1550 | ahd_send_async(ahd, devinfo.channel, devinfo.target, | 1550 | ahd_send_async(ahd, devinfo.channel, devinfo.target, |
@@ -1794,7 +1794,7 @@ ahd_done(struct ahd_softc *ahd, struct scb *scb) | |||
1794 | struct ahd_linux_device *dev; | 1794 | struct ahd_linux_device *dev; |
1795 | 1795 | ||
1796 | if ((scb->flags & SCB_ACTIVE) == 0) { | 1796 | if ((scb->flags & SCB_ACTIVE) == 0) { |
1797 | printf("SCB %d done'd twice\n", SCB_GET_TAG(scb)); | 1797 | printk("SCB %d done'd twice\n", SCB_GET_TAG(scb)); |
1798 | ahd_dump_card_state(ahd); | 1798 | ahd_dump_card_state(ahd); |
1799 | panic("Stopping for safety"); | 1799 | panic("Stopping for safety"); |
1800 | } | 1800 | } |
@@ -1825,7 +1825,7 @@ ahd_done(struct ahd_softc *ahd, struct scb *scb) | |||
1825 | #ifdef AHD_DEBUG | 1825 | #ifdef AHD_DEBUG |
1826 | if ((ahd_debug & AHD_SHOW_MISC) != 0) { | 1826 | if ((ahd_debug & AHD_SHOW_MISC) != 0) { |
1827 | ahd_print_path(ahd, scb); | 1827 | ahd_print_path(ahd, scb); |
1828 | printf("Set CAM_UNCOR_PARITY\n"); | 1828 | printk("Set CAM_UNCOR_PARITY\n"); |
1829 | } | 1829 | } |
1830 | #endif | 1830 | #endif |
1831 | ahd_set_transaction_status(scb, CAM_UNCOR_PARITY); | 1831 | ahd_set_transaction_status(scb, CAM_UNCOR_PARITY); |
@@ -1843,12 +1843,12 @@ ahd_done(struct ahd_softc *ahd, struct scb *scb) | |||
1843 | u_int i; | 1843 | u_int i; |
1844 | 1844 | ||
1845 | ahd_print_path(ahd, scb); | 1845 | ahd_print_path(ahd, scb); |
1846 | printf("CDB:"); | 1846 | printk("CDB:"); |
1847 | for (i = 0; i < scb->io_ctx->cmd_len; i++) | 1847 | for (i = 0; i < scb->io_ctx->cmd_len; i++) |
1848 | printf(" 0x%x", scb->io_ctx->cmnd[i]); | 1848 | printk(" 0x%x", scb->io_ctx->cmnd[i]); |
1849 | printf("\n"); | 1849 | printk("\n"); |
1850 | ahd_print_path(ahd, scb); | 1850 | ahd_print_path(ahd, scb); |
1851 | printf("Saw underflow (%ld of %ld bytes). " | 1851 | printk("Saw underflow (%ld of %ld bytes). " |
1852 | "Treated as error\n", | 1852 | "Treated as error\n", |
1853 | ahd_get_residual(scb), | 1853 | ahd_get_residual(scb), |
1854 | ahd_get_transfer_length(scb)); | 1854 | ahd_get_transfer_length(scb)); |
@@ -1881,7 +1881,7 @@ ahd_done(struct ahd_softc *ahd, struct scb *scb) | |||
1881 | dev->commands_since_idle_or_otag = 0; | 1881 | dev->commands_since_idle_or_otag = 0; |
1882 | 1882 | ||
1883 | if ((scb->flags & SCB_RECOVERY_SCB) != 0) { | 1883 | if ((scb->flags & SCB_RECOVERY_SCB) != 0) { |
1884 | printf("Recovery SCB completes\n"); | 1884 | printk("Recovery SCB completes\n"); |
1885 | if (ahd_get_transaction_status(scb) == CAM_BDR_SENT | 1885 | if (ahd_get_transaction_status(scb) == CAM_BDR_SENT |
1886 | || ahd_get_transaction_status(scb) == CAM_REQ_ABORTED) | 1886 | || ahd_get_transaction_status(scb) == CAM_REQ_ABORTED) |
1887 | ahd_set_transaction_status(scb, CAM_CMD_TIMEOUT); | 1887 | ahd_set_transaction_status(scb, CAM_CMD_TIMEOUT); |
@@ -1963,14 +1963,14 @@ ahd_linux_handle_scsi_status(struct ahd_softc *ahd, | |||
1963 | if (ahd_debug & AHD_SHOW_SENSE) { | 1963 | if (ahd_debug & AHD_SHOW_SENSE) { |
1964 | int i; | 1964 | int i; |
1965 | 1965 | ||
1966 | printf("Copied %d bytes of sense data at %d:", | 1966 | printk("Copied %d bytes of sense data at %d:", |
1967 | sense_size, sense_offset); | 1967 | sense_size, sense_offset); |
1968 | for (i = 0; i < sense_size; i++) { | 1968 | for (i = 0; i < sense_size; i++) { |
1969 | if ((i & 0xF) == 0) | 1969 | if ((i & 0xF) == 0) |
1970 | printf("\n"); | 1970 | printk("\n"); |
1971 | printf("0x%x ", cmd->sense_buffer[i]); | 1971 | printk("0x%x ", cmd->sense_buffer[i]); |
1972 | } | 1972 | } |
1973 | printf("\n"); | 1973 | printk("\n"); |
1974 | } | 1974 | } |
1975 | #endif | 1975 | #endif |
1976 | } | 1976 | } |
@@ -1995,7 +1995,7 @@ ahd_linux_handle_scsi_status(struct ahd_softc *ahd, | |||
1995 | #ifdef AHD_DEBUG | 1995 | #ifdef AHD_DEBUG |
1996 | if ((ahd_debug & AHD_SHOW_QFULL) != 0) { | 1996 | if ((ahd_debug & AHD_SHOW_QFULL) != 0) { |
1997 | ahd_print_path(ahd, scb); | 1997 | ahd_print_path(ahd, scb); |
1998 | printf("Dropping tag count to %d\n", | 1998 | printk("Dropping tag count to %d\n", |
1999 | dev->active); | 1999 | dev->active); |
2000 | } | 2000 | } |
2001 | #endif | 2001 | #endif |
@@ -2014,7 +2014,7 @@ ahd_linux_handle_scsi_status(struct ahd_softc *ahd, | |||
2014 | == AHD_LOCK_TAGS_COUNT) { | 2014 | == AHD_LOCK_TAGS_COUNT) { |
2015 | dev->maxtags = dev->active; | 2015 | dev->maxtags = dev->active; |
2016 | ahd_print_path(ahd, scb); | 2016 | ahd_print_path(ahd, scb); |
2017 | printf("Locking max tag count at %d\n", | 2017 | printk("Locking max tag count at %d\n", |
2018 | dev->active); | 2018 | dev->active); |
2019 | } | 2019 | } |
2020 | } else { | 2020 | } else { |
@@ -2138,7 +2138,7 @@ ahd_linux_queue_cmd_complete(struct ahd_softc *ahd, struct scsi_cmnd *cmd) | |||
2138 | } | 2138 | } |
2139 | 2139 | ||
2140 | if (do_fallback) { | 2140 | if (do_fallback) { |
2141 | printf("%s: device overrun (status %x) on %d:%d:%d\n", | 2141 | printk("%s: device overrun (status %x) on %d:%d:%d\n", |
2142 | ahd_name(ahd), status, cmd->device->channel, | 2142 | ahd_name(ahd), status, cmd->device->channel, |
2143 | cmd->device->id, cmd->device->lun); | 2143 | cmd->device->id, cmd->device->lun); |
2144 | } | 2144 | } |
@@ -2187,10 +2187,10 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd *cmd) | |||
2187 | scmd_printk(KERN_INFO, cmd, | 2187 | scmd_printk(KERN_INFO, cmd, |
2188 | "Attempting to queue an ABORT message:"); | 2188 | "Attempting to queue an ABORT message:"); |
2189 | 2189 | ||
2190 | printf("CDB:"); | 2190 | printk("CDB:"); |
2191 | for (cdb_byte = 0; cdb_byte < cmd->cmd_len; cdb_byte++) | 2191 | for (cdb_byte = 0; cdb_byte < cmd->cmd_len; cdb_byte++) |
2192 | printf(" 0x%x", cmd->cmnd[cdb_byte]); | 2192 | printk(" 0x%x", cmd->cmnd[cdb_byte]); |
2193 | printf("\n"); | 2193 | printk("\n"); |
2194 | 2194 | ||
2195 | ahd_lock(ahd, &flags); | 2195 | ahd_lock(ahd, &flags); |
2196 | 2196 | ||
@@ -2249,7 +2249,7 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd *cmd) | |||
2249 | goto no_cmd; | 2249 | goto no_cmd; |
2250 | } | 2250 | } |
2251 | 2251 | ||
2252 | printf("%s: At time of recovery, card was %spaused\n", | 2252 | printk("%s: At time of recovery, card was %spaused\n", |
2253 | ahd_name(ahd), was_paused ? "" : "not "); | 2253 | ahd_name(ahd), was_paused ? "" : "not "); |
2254 | ahd_dump_card_state(ahd); | 2254 | ahd_dump_card_state(ahd); |
2255 | 2255 | ||
@@ -2260,7 +2260,7 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd *cmd) | |||
2260 | pending_scb->hscb->tag, | 2260 | pending_scb->hscb->tag, |
2261 | ROLE_INITIATOR, CAM_REQ_ABORTED, | 2261 | ROLE_INITIATOR, CAM_REQ_ABORTED, |
2262 | SEARCH_COMPLETE) > 0) { | 2262 | SEARCH_COMPLETE) > 0) { |
2263 | printf("%s:%d:%d:%d: Cmd aborted from QINFIFO\n", | 2263 | printk("%s:%d:%d:%d: Cmd aborted from QINFIFO\n", |
2264 | ahd_name(ahd), cmd->device->channel, | 2264 | ahd_name(ahd), cmd->device->channel, |
2265 | cmd->device->id, cmd->device->lun); | 2265 | cmd->device->id, cmd->device->lun); |
2266 | retval = SUCCESS; | 2266 | retval = SUCCESS; |
@@ -2355,7 +2355,7 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd *cmd) | |||
2355 | ahd_qinfifo_requeue_tail(ahd, pending_scb); | 2355 | ahd_qinfifo_requeue_tail(ahd, pending_scb); |
2356 | ahd_set_scbptr(ahd, saved_scbptr); | 2356 | ahd_set_scbptr(ahd, saved_scbptr); |
2357 | ahd_print_path(ahd, pending_scb); | 2357 | ahd_print_path(ahd, pending_scb); |
2358 | printf("Device is disconnected, re-queuing SCB\n"); | 2358 | printk("Device is disconnected, re-queuing SCB\n"); |
2359 | wait = TRUE; | 2359 | wait = TRUE; |
2360 | } else { | 2360 | } else { |
2361 | scmd_printk(KERN_INFO, cmd, "Unable to deliver message\n"); | 2361 | scmd_printk(KERN_INFO, cmd, "Unable to deliver message\n"); |
@@ -2380,21 +2380,21 @@ done: | |||
2380 | ahd->platform_data->eh_done = &done; | 2380 | ahd->platform_data->eh_done = &done; |
2381 | ahd_unlock(ahd, &flags); | 2381 | ahd_unlock(ahd, &flags); |
2382 | 2382 | ||
2383 | printf("%s: Recovery code sleeping\n", ahd_name(ahd)); | 2383 | printk("%s: Recovery code sleeping\n", ahd_name(ahd)); |
2384 | if (!wait_for_completion_timeout(&done, 5 * HZ)) { | 2384 | if (!wait_for_completion_timeout(&done, 5 * HZ)) { |
2385 | ahd_lock(ahd, &flags); | 2385 | ahd_lock(ahd, &flags); |
2386 | ahd->platform_data->eh_done = NULL; | 2386 | ahd->platform_data->eh_done = NULL; |
2387 | ahd_unlock(ahd, &flags); | 2387 | ahd_unlock(ahd, &flags); |
2388 | printf("%s: Timer Expired (active %d)\n", | 2388 | printk("%s: Timer Expired (active %d)\n", |
2389 | ahd_name(ahd), dev->active); | 2389 | ahd_name(ahd), dev->active); |
2390 | retval = FAILED; | 2390 | retval = FAILED; |
2391 | } | 2391 | } |
2392 | printf("Recovery code awake\n"); | 2392 | printk("Recovery code awake\n"); |
2393 | } else | 2393 | } else |
2394 | ahd_unlock(ahd, &flags); | 2394 | ahd_unlock(ahd, &flags); |
2395 | 2395 | ||
2396 | if (retval != SUCCESS) | 2396 | if (retval != SUCCESS) |
2397 | printf("%s: Command abort returning 0x%x\n", | 2397 | printk("%s: Command abort returning 0x%x\n", |
2398 | ahd_name(ahd), retval); | 2398 | ahd_name(ahd), retval); |
2399 | 2399 | ||
2400 | return retval; | 2400 | return retval; |
@@ -2431,7 +2431,7 @@ static void ahd_linux_set_period(struct scsi_target *starget, int period) | |||
2431 | 2431 | ||
2432 | #ifdef AHD_DEBUG | 2432 | #ifdef AHD_DEBUG |
2433 | if ((ahd_debug & AHD_SHOW_DV) != 0) | 2433 | if ((ahd_debug & AHD_SHOW_DV) != 0) |
2434 | printf("%s: set period to %d\n", ahd_name(ahd), period); | 2434 | printk("%s: set period to %d\n", ahd_name(ahd), period); |
2435 | #endif | 2435 | #endif |
2436 | if (offset == 0) | 2436 | if (offset == 0) |
2437 | offset = MAX_OFFSET; | 2437 | offset = MAX_OFFSET; |
@@ -2484,7 +2484,7 @@ static void ahd_linux_set_offset(struct scsi_target *starget, int offset) | |||
2484 | 2484 | ||
2485 | #ifdef AHD_DEBUG | 2485 | #ifdef AHD_DEBUG |
2486 | if ((ahd_debug & AHD_SHOW_DV) != 0) | 2486 | if ((ahd_debug & AHD_SHOW_DV) != 0) |
2487 | printf("%s: set offset to %d\n", ahd_name(ahd), offset); | 2487 | printk("%s: set offset to %d\n", ahd_name(ahd), offset); |
2488 | #endif | 2488 | #endif |
2489 | 2489 | ||
2490 | ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, | 2490 | ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, |
@@ -2520,7 +2520,7 @@ static void ahd_linux_set_dt(struct scsi_target *starget, int dt) | |||
2520 | 2520 | ||
2521 | #ifdef AHD_DEBUG | 2521 | #ifdef AHD_DEBUG |
2522 | if ((ahd_debug & AHD_SHOW_DV) != 0) | 2522 | if ((ahd_debug & AHD_SHOW_DV) != 0) |
2523 | printf("%s: %s DT\n", ahd_name(ahd), | 2523 | printk("%s: %s DT\n", ahd_name(ahd), |
2524 | dt ? "enabling" : "disabling"); | 2524 | dt ? "enabling" : "disabling"); |
2525 | #endif | 2525 | #endif |
2526 | if (dt && spi_max_width(starget)) { | 2526 | if (dt && spi_max_width(starget)) { |
@@ -2562,7 +2562,7 @@ static void ahd_linux_set_qas(struct scsi_target *starget, int qas) | |||
2562 | 2562 | ||
2563 | #ifdef AHD_DEBUG | 2563 | #ifdef AHD_DEBUG |
2564 | if ((ahd_debug & AHD_SHOW_DV) != 0) | 2564 | if ((ahd_debug & AHD_SHOW_DV) != 0) |
2565 | printf("%s: %s QAS\n", ahd_name(ahd), | 2565 | printk("%s: %s QAS\n", ahd_name(ahd), |
2566 | qas ? "enabling" : "disabling"); | 2566 | qas ? "enabling" : "disabling"); |
2567 | #endif | 2567 | #endif |
2568 | 2568 | ||
@@ -2601,7 +2601,7 @@ static void ahd_linux_set_iu(struct scsi_target *starget, int iu) | |||
2601 | 2601 | ||
2602 | #ifdef AHD_DEBUG | 2602 | #ifdef AHD_DEBUG |
2603 | if ((ahd_debug & AHD_SHOW_DV) != 0) | 2603 | if ((ahd_debug & AHD_SHOW_DV) != 0) |
2604 | printf("%s: %s IU\n", ahd_name(ahd), | 2604 | printk("%s: %s IU\n", ahd_name(ahd), |
2605 | iu ? "enabling" : "disabling"); | 2605 | iu ? "enabling" : "disabling"); |
2606 | #endif | 2606 | #endif |
2607 | 2607 | ||
@@ -2641,7 +2641,7 @@ static void ahd_linux_set_rd_strm(struct scsi_target *starget, int rdstrm) | |||
2641 | 2641 | ||
2642 | #ifdef AHD_DEBUG | 2642 | #ifdef AHD_DEBUG |
2643 | if ((ahd_debug & AHD_SHOW_DV) != 0) | 2643 | if ((ahd_debug & AHD_SHOW_DV) != 0) |
2644 | printf("%s: %s Read Streaming\n", ahd_name(ahd), | 2644 | printk("%s: %s Read Streaming\n", ahd_name(ahd), |
2645 | rdstrm ? "enabling" : "disabling"); | 2645 | rdstrm ? "enabling" : "disabling"); |
2646 | #endif | 2646 | #endif |
2647 | 2647 | ||
@@ -2677,7 +2677,7 @@ static void ahd_linux_set_wr_flow(struct scsi_target *starget, int wrflow) | |||
2677 | 2677 | ||
2678 | #ifdef AHD_DEBUG | 2678 | #ifdef AHD_DEBUG |
2679 | if ((ahd_debug & AHD_SHOW_DV) != 0) | 2679 | if ((ahd_debug & AHD_SHOW_DV) != 0) |
2680 | printf("%s: %s Write Flow Control\n", ahd_name(ahd), | 2680 | printk("%s: %s Write Flow Control\n", ahd_name(ahd), |
2681 | wrflow ? "enabling" : "disabling"); | 2681 | wrflow ? "enabling" : "disabling"); |
2682 | #endif | 2682 | #endif |
2683 | 2683 | ||
@@ -2714,14 +2714,14 @@ static void ahd_linux_set_rti(struct scsi_target *starget, int rti) | |||
2714 | if ((ahd->features & AHD_RTI) == 0) { | 2714 | if ((ahd->features & AHD_RTI) == 0) { |
2715 | #ifdef AHD_DEBUG | 2715 | #ifdef AHD_DEBUG |
2716 | if ((ahd_debug & AHD_SHOW_DV) != 0) | 2716 | if ((ahd_debug & AHD_SHOW_DV) != 0) |
2717 | printf("%s: RTI not available\n", ahd_name(ahd)); | 2717 | printk("%s: RTI not available\n", ahd_name(ahd)); |
2718 | #endif | 2718 | #endif |
2719 | return; | 2719 | return; |
2720 | } | 2720 | } |
2721 | 2721 | ||
2722 | #ifdef AHD_DEBUG | 2722 | #ifdef AHD_DEBUG |
2723 | if ((ahd_debug & AHD_SHOW_DV) != 0) | 2723 | if ((ahd_debug & AHD_SHOW_DV) != 0) |
2724 | printf("%s: %s RTI\n", ahd_name(ahd), | 2724 | printk("%s: %s RTI\n", ahd_name(ahd), |
2725 | rti ? "enabling" : "disabling"); | 2725 | rti ? "enabling" : "disabling"); |
2726 | #endif | 2726 | #endif |
2727 | 2727 | ||
@@ -2757,7 +2757,7 @@ static void ahd_linux_set_pcomp_en(struct scsi_target *starget, int pcomp) | |||
2757 | 2757 | ||
2758 | #ifdef AHD_DEBUG | 2758 | #ifdef AHD_DEBUG |
2759 | if ((ahd_debug & AHD_SHOW_DV) != 0) | 2759 | if ((ahd_debug & AHD_SHOW_DV) != 0) |
2760 | printf("%s: %s Precompensation\n", ahd_name(ahd), | 2760 | printk("%s: %s Precompensation\n", ahd_name(ahd), |
2761 | pcomp ? "Enable" : "Disable"); | 2761 | pcomp ? "Enable" : "Disable"); |
2762 | #endif | 2762 | #endif |
2763 | 2763 | ||
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.h b/drivers/scsi/aic7xxx/aic79xx_osm.h index 55c1fe07969f..28e43498cdff 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.h +++ b/drivers/scsi/aic7xxx/aic79xx_osm.h | |||
@@ -363,13 +363,6 @@ struct ahd_platform_data { | |||
363 | resource_size_t mem_busaddr; /* Mem Base Addr */ | 363 | resource_size_t mem_busaddr; /* Mem Base Addr */ |
364 | }; | 364 | }; |
365 | 365 | ||
366 | /************************** OS Utility Wrappers *******************************/ | ||
367 | #define printf printk | ||
368 | #define M_NOWAIT GFP_ATOMIC | ||
369 | #define M_WAITOK 0 | ||
370 | #define malloc(size, type, flags) kmalloc(size, flags) | ||
371 | #define free(ptr, type) kfree(ptr) | ||
372 | |||
373 | void ahd_delay(long); | 366 | void ahd_delay(long); |
374 | 367 | ||
375 | /***************************** Low Level I/O **********************************/ | 368 | /***************************** Low Level I/O **********************************/ |
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c index 8f686122d54e..3c85873b14b9 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c +++ b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c | |||
@@ -178,7 +178,7 @@ ahd_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
178 | ahd_get_pci_bus(pci), | 178 | ahd_get_pci_bus(pci), |
179 | ahd_get_pci_slot(pci), | 179 | ahd_get_pci_slot(pci), |
180 | ahd_get_pci_function(pci)); | 180 | ahd_get_pci_function(pci)); |
181 | name = malloc(strlen(buf) + 1, M_DEVBUF, M_NOWAIT); | 181 | name = kmalloc(strlen(buf) + 1, GFP_ATOMIC); |
182 | if (name == NULL) | 182 | if (name == NULL) |
183 | return (-ENOMEM); | 183 | return (-ENOMEM); |
184 | strcpy(name, buf); | 184 | strcpy(name, buf); |
@@ -333,7 +333,7 @@ ahd_pci_map_registers(struct ahd_softc *ahd) | |||
333 | 333 | ||
334 | if (ahd_pci_test_register_access(ahd) != 0) { | 334 | if (ahd_pci_test_register_access(ahd) != 0) { |
335 | 335 | ||
336 | printf("aic79xx: PCI Device %d:%d:%d " | 336 | printk("aic79xx: PCI Device %d:%d:%d " |
337 | "failed memory mapped test. Using PIO.\n", | 337 | "failed memory mapped test. Using PIO.\n", |
338 | ahd_get_pci_bus(ahd->dev_softc), | 338 | ahd_get_pci_bus(ahd->dev_softc), |
339 | ahd_get_pci_slot(ahd->dev_softc), | 339 | ahd_get_pci_slot(ahd->dev_softc), |
@@ -346,7 +346,7 @@ ahd_pci_map_registers(struct ahd_softc *ahd) | |||
346 | } else | 346 | } else |
347 | command |= PCIM_CMD_MEMEN; | 347 | command |= PCIM_CMD_MEMEN; |
348 | } else if (bootverbose) { | 348 | } else if (bootverbose) { |
349 | printf("aic79xx: PCI%d:%d:%d MEM region 0x%llx " | 349 | printk("aic79xx: PCI%d:%d:%d MEM region 0x%llx " |
350 | "unavailable. Cannot memory map device.\n", | 350 | "unavailable. Cannot memory map device.\n", |
351 | ahd_get_pci_bus(ahd->dev_softc), | 351 | ahd_get_pci_bus(ahd->dev_softc), |
352 | ahd_get_pci_slot(ahd->dev_softc), | 352 | ahd_get_pci_slot(ahd->dev_softc), |
@@ -365,7 +365,7 @@ ahd_pci_map_registers(struct ahd_softc *ahd) | |||
365 | ahd->bshs[1].ioport = (u_long)base2; | 365 | ahd->bshs[1].ioport = (u_long)base2; |
366 | command |= PCIM_CMD_PORTEN; | 366 | command |= PCIM_CMD_PORTEN; |
367 | } else { | 367 | } else { |
368 | printf("aic79xx: PCI%d:%d:%d IO regions 0x%llx and " | 368 | printk("aic79xx: PCI%d:%d:%d IO regions 0x%llx and " |
369 | "0x%llx unavailable. Cannot map device.\n", | 369 | "0x%llx unavailable. Cannot map device.\n", |
370 | ahd_get_pci_bus(ahd->dev_softc), | 370 | ahd_get_pci_bus(ahd->dev_softc), |
371 | ahd_get_pci_slot(ahd->dev_softc), | 371 | ahd_get_pci_slot(ahd->dev_softc), |
diff --git a/drivers/scsi/aic7xxx/aic79xx_pci.c b/drivers/scsi/aic7xxx/aic79xx_pci.c index 90a04a37b4f7..14b5f8d0e7f4 100644 --- a/drivers/scsi/aic7xxx/aic79xx_pci.c +++ b/drivers/scsi/aic7xxx/aic79xx_pci.c | |||
@@ -338,7 +338,7 @@ ahd_pci_config(struct ahd_softc *ahd, const struct ahd_pci_identity *entry) | |||
338 | */ | 338 | */ |
339 | if ((ahd->flags & (AHD_39BIT_ADDRESSING|AHD_64BIT_ADDRESSING)) != 0) { | 339 | if ((ahd->flags & (AHD_39BIT_ADDRESSING|AHD_64BIT_ADDRESSING)) != 0) { |
340 | if (bootverbose) | 340 | if (bootverbose) |
341 | printf("%s: Enabling 39Bit Addressing\n", | 341 | printk("%s: Enabling 39Bit Addressing\n", |
342 | ahd_name(ahd)); | 342 | ahd_name(ahd)); |
343 | devconfig = ahd_pci_read_config(ahd->dev_softc, | 343 | devconfig = ahd_pci_read_config(ahd->dev_softc, |
344 | DEVCONFIG, /*bytes*/4); | 344 | DEVCONFIG, /*bytes*/4); |
@@ -528,7 +528,7 @@ ahd_check_extport(struct ahd_softc *ahd) | |||
528 | * Fetch VPD for this function and parse it. | 528 | * Fetch VPD for this function and parse it. |
529 | */ | 529 | */ |
530 | if (bootverbose) | 530 | if (bootverbose) |
531 | printf("%s: Reading VPD from SEEPROM...", | 531 | printk("%s: Reading VPD from SEEPROM...", |
532 | ahd_name(ahd)); | 532 | ahd_name(ahd)); |
533 | 533 | ||
534 | /* Address is always in units of 16bit words */ | 534 | /* Address is always in units of 16bit words */ |
@@ -541,12 +541,12 @@ ahd_check_extport(struct ahd_softc *ahd) | |||
541 | if (error == 0) | 541 | if (error == 0) |
542 | error = ahd_parse_vpddata(ahd, &vpd); | 542 | error = ahd_parse_vpddata(ahd, &vpd); |
543 | if (bootverbose) | 543 | if (bootverbose) |
544 | printf("%s: VPD parsing %s\n", | 544 | printk("%s: VPD parsing %s\n", |
545 | ahd_name(ahd), | 545 | ahd_name(ahd), |
546 | error == 0 ? "successful" : "failed"); | 546 | error == 0 ? "successful" : "failed"); |
547 | 547 | ||
548 | if (bootverbose) | 548 | if (bootverbose) |
549 | printf("%s: Reading SEEPROM...", ahd_name(ahd)); | 549 | printk("%s: Reading SEEPROM...", ahd_name(ahd)); |
550 | 550 | ||
551 | /* Address is always in units of 16bit words */ | 551 | /* Address is always in units of 16bit words */ |
552 | start_addr = (sizeof(*sc) / 2) * (ahd->channel - 'A'); | 552 | start_addr = (sizeof(*sc) / 2) * (ahd->channel - 'A'); |
@@ -556,16 +556,16 @@ ahd_check_extport(struct ahd_softc *ahd) | |||
556 | /*bytestream*/FALSE); | 556 | /*bytestream*/FALSE); |
557 | 557 | ||
558 | if (error != 0) { | 558 | if (error != 0) { |
559 | printf("Unable to read SEEPROM\n"); | 559 | printk("Unable to read SEEPROM\n"); |
560 | have_seeprom = 0; | 560 | have_seeprom = 0; |
561 | } else { | 561 | } else { |
562 | have_seeprom = ahd_verify_cksum(sc); | 562 | have_seeprom = ahd_verify_cksum(sc); |
563 | 563 | ||
564 | if (bootverbose) { | 564 | if (bootverbose) { |
565 | if (have_seeprom == 0) | 565 | if (have_seeprom == 0) |
566 | printf ("checksum error\n"); | 566 | printk ("checksum error\n"); |
567 | else | 567 | else |
568 | printf ("done.\n"); | 568 | printk ("done.\n"); |
569 | } | 569 | } |
570 | } | 570 | } |
571 | ahd_release_seeprom(ahd); | 571 | ahd_release_seeprom(ahd); |
@@ -615,21 +615,21 @@ ahd_check_extport(struct ahd_softc *ahd) | |||
615 | uint16_t *sc_data; | 615 | uint16_t *sc_data; |
616 | int i; | 616 | int i; |
617 | 617 | ||
618 | printf("%s: Seeprom Contents:", ahd_name(ahd)); | 618 | printk("%s: Seeprom Contents:", ahd_name(ahd)); |
619 | sc_data = (uint16_t *)sc; | 619 | sc_data = (uint16_t *)sc; |
620 | for (i = 0; i < (sizeof(*sc)); i += 2) | 620 | for (i = 0; i < (sizeof(*sc)); i += 2) |
621 | printf("\n\t0x%.4x", sc_data[i]); | 621 | printk("\n\t0x%.4x", sc_data[i]); |
622 | printf("\n"); | 622 | printk("\n"); |
623 | } | 623 | } |
624 | #endif | 624 | #endif |
625 | 625 | ||
626 | if (!have_seeprom) { | 626 | if (!have_seeprom) { |
627 | if (bootverbose) | 627 | if (bootverbose) |
628 | printf("%s: No SEEPROM available.\n", ahd_name(ahd)); | 628 | printk("%s: No SEEPROM available.\n", ahd_name(ahd)); |
629 | ahd->flags |= AHD_USEDEFAULTS; | 629 | ahd->flags |= AHD_USEDEFAULTS; |
630 | error = ahd_default_config(ahd); | 630 | error = ahd_default_config(ahd); |
631 | adapter_control = CFAUTOTERM|CFSEAUTOTERM; | 631 | adapter_control = CFAUTOTERM|CFSEAUTOTERM; |
632 | free(ahd->seep_config, M_DEVBUF); | 632 | kfree(ahd->seep_config); |
633 | ahd->seep_config = NULL; | 633 | ahd->seep_config = NULL; |
634 | } else { | 634 | } else { |
635 | error = ahd_parse_cfgdata(ahd, sc); | 635 | error = ahd_parse_cfgdata(ahd, sc); |
@@ -656,7 +656,7 @@ ahd_configure_termination(struct ahd_softc *ahd, u_int adapter_control) | |||
656 | if ((ahd->flags & AHD_STPWLEVEL_A) != 0) | 656 | if ((ahd->flags & AHD_STPWLEVEL_A) != 0) |
657 | devconfig |= STPWLEVEL; | 657 | devconfig |= STPWLEVEL; |
658 | if (bootverbose) | 658 | if (bootverbose) |
659 | printf("%s: STPWLEVEL is %s\n", | 659 | printk("%s: STPWLEVEL is %s\n", |
660 | ahd_name(ahd), (devconfig & STPWLEVEL) ? "on" : "off"); | 660 | ahd_name(ahd), (devconfig & STPWLEVEL) ? "on" : "off"); |
661 | ahd_pci_write_config(ahd->dev_softc, DEVCONFIG, devconfig, /*bytes*/4); | 661 | ahd_pci_write_config(ahd->dev_softc, DEVCONFIG, devconfig, /*bytes*/4); |
662 | 662 | ||
@@ -671,7 +671,7 @@ ahd_configure_termination(struct ahd_softc *ahd, u_int adapter_control) | |||
671 | error = ahd_read_flexport(ahd, FLXADDR_TERMCTL, &termctl); | 671 | error = ahd_read_flexport(ahd, FLXADDR_TERMCTL, &termctl); |
672 | if ((adapter_control & CFAUTOTERM) == 0) { | 672 | if ((adapter_control & CFAUTOTERM) == 0) { |
673 | if (bootverbose) | 673 | if (bootverbose) |
674 | printf("%s: Manual Primary Termination\n", | 674 | printk("%s: Manual Primary Termination\n", |
675 | ahd_name(ahd)); | 675 | ahd_name(ahd)); |
676 | termctl &= ~(FLX_TERMCTL_ENPRILOW|FLX_TERMCTL_ENPRIHIGH); | 676 | termctl &= ~(FLX_TERMCTL_ENPRILOW|FLX_TERMCTL_ENPRIHIGH); |
677 | if ((adapter_control & CFSTERM) != 0) | 677 | if ((adapter_control & CFSTERM) != 0) |
@@ -679,14 +679,14 @@ ahd_configure_termination(struct ahd_softc *ahd, u_int adapter_control) | |||
679 | if ((adapter_control & CFWSTERM) != 0) | 679 | if ((adapter_control & CFWSTERM) != 0) |
680 | termctl |= FLX_TERMCTL_ENPRIHIGH; | 680 | termctl |= FLX_TERMCTL_ENPRIHIGH; |
681 | } else if (error != 0) { | 681 | } else if (error != 0) { |
682 | printf("%s: Primary Auto-Term Sensing failed! " | 682 | printk("%s: Primary Auto-Term Sensing failed! " |
683 | "Using Defaults.\n", ahd_name(ahd)); | 683 | "Using Defaults.\n", ahd_name(ahd)); |
684 | termctl = FLX_TERMCTL_ENPRILOW|FLX_TERMCTL_ENPRIHIGH; | 684 | termctl = FLX_TERMCTL_ENPRILOW|FLX_TERMCTL_ENPRIHIGH; |
685 | } | 685 | } |
686 | 686 | ||
687 | if ((adapter_control & CFSEAUTOTERM) == 0) { | 687 | if ((adapter_control & CFSEAUTOTERM) == 0) { |
688 | if (bootverbose) | 688 | if (bootverbose) |
689 | printf("%s: Manual Secondary Termination\n", | 689 | printk("%s: Manual Secondary Termination\n", |
690 | ahd_name(ahd)); | 690 | ahd_name(ahd)); |
691 | termctl &= ~(FLX_TERMCTL_ENSECLOW|FLX_TERMCTL_ENSECHIGH); | 691 | termctl &= ~(FLX_TERMCTL_ENSECLOW|FLX_TERMCTL_ENSECHIGH); |
692 | if ((adapter_control & CFSELOWTERM) != 0) | 692 | if ((adapter_control & CFSELOWTERM) != 0) |
@@ -694,7 +694,7 @@ ahd_configure_termination(struct ahd_softc *ahd, u_int adapter_control) | |||
694 | if ((adapter_control & CFSEHIGHTERM) != 0) | 694 | if ((adapter_control & CFSEHIGHTERM) != 0) |
695 | termctl |= FLX_TERMCTL_ENSECHIGH; | 695 | termctl |= FLX_TERMCTL_ENSECHIGH; |
696 | } else if (error != 0) { | 696 | } else if (error != 0) { |
697 | printf("%s: Secondary Auto-Term Sensing failed! " | 697 | printk("%s: Secondary Auto-Term Sensing failed! " |
698 | "Using Defaults.\n", ahd_name(ahd)); | 698 | "Using Defaults.\n", ahd_name(ahd)); |
699 | termctl |= FLX_TERMCTL_ENSECLOW|FLX_TERMCTL_ENSECHIGH; | 699 | termctl |= FLX_TERMCTL_ENSECLOW|FLX_TERMCTL_ENSECHIGH; |
700 | } | 700 | } |
@@ -714,22 +714,22 @@ ahd_configure_termination(struct ahd_softc *ahd, u_int adapter_control) | |||
714 | 714 | ||
715 | error = ahd_write_flexport(ahd, FLXADDR_TERMCTL, termctl); | 715 | error = ahd_write_flexport(ahd, FLXADDR_TERMCTL, termctl); |
716 | if (error != 0) { | 716 | if (error != 0) { |
717 | printf("%s: Unable to set termination settings!\n", | 717 | printk("%s: Unable to set termination settings!\n", |
718 | ahd_name(ahd)); | 718 | ahd_name(ahd)); |
719 | } else if (bootverbose) { | 719 | } else if (bootverbose) { |
720 | printf("%s: Primary High byte termination %sabled\n", | 720 | printk("%s: Primary High byte termination %sabled\n", |
721 | ahd_name(ahd), | 721 | ahd_name(ahd), |
722 | (termctl & FLX_TERMCTL_ENPRIHIGH) ? "En" : "Dis"); | 722 | (termctl & FLX_TERMCTL_ENPRIHIGH) ? "En" : "Dis"); |
723 | 723 | ||
724 | printf("%s: Primary Low byte termination %sabled\n", | 724 | printk("%s: Primary Low byte termination %sabled\n", |
725 | ahd_name(ahd), | 725 | ahd_name(ahd), |
726 | (termctl & FLX_TERMCTL_ENPRILOW) ? "En" : "Dis"); | 726 | (termctl & FLX_TERMCTL_ENPRILOW) ? "En" : "Dis"); |
727 | 727 | ||
728 | printf("%s: Secondary High byte termination %sabled\n", | 728 | printk("%s: Secondary High byte termination %sabled\n", |
729 | ahd_name(ahd), | 729 | ahd_name(ahd), |
730 | (termctl & FLX_TERMCTL_ENSECHIGH) ? "En" : "Dis"); | 730 | (termctl & FLX_TERMCTL_ENSECHIGH) ? "En" : "Dis"); |
731 | 731 | ||
732 | printf("%s: Secondary Low byte termination %sabled\n", | 732 | printk("%s: Secondary Low byte termination %sabled\n", |
733 | ahd_name(ahd), | 733 | ahd_name(ahd), |
734 | (termctl & FLX_TERMCTL_ENSECLOW) ? "En" : "Dis"); | 734 | (termctl & FLX_TERMCTL_ENSECLOW) ? "En" : "Dis"); |
735 | } | 735 | } |
@@ -805,7 +805,7 @@ ahd_pci_intr(struct ahd_softc *ahd) | |||
805 | if ((intstat & PCIINT) == 0) | 805 | if ((intstat & PCIINT) == 0) |
806 | return; | 806 | return; |
807 | 807 | ||
808 | printf("%s: PCI error Interrupt\n", ahd_name(ahd)); | 808 | printk("%s: PCI error Interrupt\n", ahd_name(ahd)); |
809 | saved_modes = ahd_save_modes(ahd); | 809 | saved_modes = ahd_save_modes(ahd); |
810 | ahd_dump_card_state(ahd); | 810 | ahd_dump_card_state(ahd); |
811 | ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG); | 811 | ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG); |
@@ -832,7 +832,7 @@ ahd_pci_intr(struct ahd_softc *ahd) | |||
832 | s = pci_status_strings[bit]; | 832 | s = pci_status_strings[bit]; |
833 | if (i == 7/*TARG*/ && bit == 3) | 833 | if (i == 7/*TARG*/ && bit == 3) |
834 | s = "%s: Signaled Target Abort\n"; | 834 | s = "%s: Signaled Target Abort\n"; |
835 | printf(s, ahd_name(ahd), pci_status_source[i]); | 835 | printk(s, ahd_name(ahd), pci_status_source[i]); |
836 | } | 836 | } |
837 | } | 837 | } |
838 | } | 838 | } |
@@ -862,7 +862,7 @@ ahd_pci_split_intr(struct ahd_softc *ahd, u_int intstat) | |||
862 | */ | 862 | */ |
863 | pcix_status = ahd_pci_read_config(ahd->dev_softc, PCIXR_STATUS, | 863 | pcix_status = ahd_pci_read_config(ahd->dev_softc, PCIXR_STATUS, |
864 | /*bytes*/2); | 864 | /*bytes*/2); |
865 | printf("%s: PCI Split Interrupt - PCI-X status = 0x%x\n", | 865 | printk("%s: PCI Split Interrupt - PCI-X status = 0x%x\n", |
866 | ahd_name(ahd), pcix_status); | 866 | ahd_name(ahd), pcix_status); |
867 | saved_modes = ahd_save_modes(ahd); | 867 | saved_modes = ahd_save_modes(ahd); |
868 | for (i = 0; i < 4; i++) { | 868 | for (i = 0; i < 4; i++) { |
@@ -891,7 +891,7 @@ ahd_pci_split_intr(struct ahd_softc *ahd, u_int intstat) | |||
891 | static const char *s; | 891 | static const char *s; |
892 | 892 | ||
893 | s = split_status_strings[bit]; | 893 | s = split_status_strings[bit]; |
894 | printf(s, ahd_name(ahd), | 894 | printk(s, ahd_name(ahd), |
895 | split_status_source[i]); | 895 | split_status_source[i]); |
896 | } | 896 | } |
897 | 897 | ||
@@ -902,7 +902,7 @@ ahd_pci_split_intr(struct ahd_softc *ahd, u_int intstat) | |||
902 | static const char *s; | 902 | static const char *s; |
903 | 903 | ||
904 | s = split_status_strings[bit]; | 904 | s = split_status_strings[bit]; |
905 | printf(s, ahd_name(ahd), "SG"); | 905 | printk(s, ahd_name(ahd), "SG"); |
906 | } | 906 | } |
907 | } | 907 | } |
908 | } | 908 | } |
@@ -950,7 +950,7 @@ ahd_aic790X_setup(struct ahd_softc *ahd) | |||
950 | pci = ahd->dev_softc; | 950 | pci = ahd->dev_softc; |
951 | rev = ahd_pci_read_config(pci, PCIR_REVID, /*bytes*/1); | 951 | rev = ahd_pci_read_config(pci, PCIR_REVID, /*bytes*/1); |
952 | if (rev < ID_AIC7902_PCI_REV_A4) { | 952 | if (rev < ID_AIC7902_PCI_REV_A4) { |
953 | printf("%s: Unable to attach to unsupported chip revision %d\n", | 953 | printk("%s: Unable to attach to unsupported chip revision %d\n", |
954 | ahd_name(ahd), rev); | 954 | ahd_name(ahd), rev); |
955 | ahd_pci_write_config(pci, PCIR_COMMAND, 0, /*bytes*/2); | 955 | ahd_pci_write_config(pci, PCIR_COMMAND, 0, /*bytes*/2); |
956 | return (ENXIO); | 956 | return (ENXIO); |
diff --git a/drivers/scsi/aic7xxx/aic79xx_proc.c b/drivers/scsi/aic7xxx/aic79xx_proc.c index 014bed716e7c..59c85d5a153a 100644 --- a/drivers/scsi/aic7xxx/aic79xx_proc.c +++ b/drivers/scsi/aic7xxx/aic79xx_proc.c | |||
@@ -272,33 +272,32 @@ ahd_proc_write_seeprom(struct ahd_softc *ahd, char *buffer, int length) | |||
272 | saved_modes = ahd_save_modes(ahd); | 272 | saved_modes = ahd_save_modes(ahd); |
273 | ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); | 273 | ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); |
274 | if (length != sizeof(struct seeprom_config)) { | 274 | if (length != sizeof(struct seeprom_config)) { |
275 | printf("ahd_proc_write_seeprom: incorrect buffer size\n"); | 275 | printk("ahd_proc_write_seeprom: incorrect buffer size\n"); |
276 | goto done; | 276 | goto done; |
277 | } | 277 | } |
278 | 278 | ||
279 | have_seeprom = ahd_verify_cksum((struct seeprom_config*)buffer); | 279 | have_seeprom = ahd_verify_cksum((struct seeprom_config*)buffer); |
280 | if (have_seeprom == 0) { | 280 | if (have_seeprom == 0) { |
281 | printf("ahd_proc_write_seeprom: cksum verification failed\n"); | 281 | printk("ahd_proc_write_seeprom: cksum verification failed\n"); |
282 | goto done; | 282 | goto done; |
283 | } | 283 | } |
284 | 284 | ||
285 | have_seeprom = ahd_acquire_seeprom(ahd); | 285 | have_seeprom = ahd_acquire_seeprom(ahd); |
286 | if (!have_seeprom) { | 286 | if (!have_seeprom) { |
287 | printf("ahd_proc_write_seeprom: No Serial EEPROM\n"); | 287 | printk("ahd_proc_write_seeprom: No Serial EEPROM\n"); |
288 | goto done; | 288 | goto done; |
289 | } else { | 289 | } else { |
290 | u_int start_addr; | 290 | u_int start_addr; |
291 | 291 | ||
292 | if (ahd->seep_config == NULL) { | 292 | if (ahd->seep_config == NULL) { |
293 | ahd->seep_config = malloc(sizeof(*ahd->seep_config), | 293 | ahd->seep_config = kmalloc(sizeof(*ahd->seep_config), GFP_ATOMIC); |
294 | M_DEVBUF, M_NOWAIT); | ||
295 | if (ahd->seep_config == NULL) { | 294 | if (ahd->seep_config == NULL) { |
296 | printf("aic79xx: Unable to allocate serial " | 295 | printk("aic79xx: Unable to allocate serial " |
297 | "eeprom buffer. Write failing\n"); | 296 | "eeprom buffer. Write failing\n"); |
298 | goto done; | 297 | goto done; |
299 | } | 298 | } |
300 | } | 299 | } |
301 | printf("aic79xx: Writing Serial EEPROM\n"); | 300 | printk("aic79xx: Writing Serial EEPROM\n"); |
302 | start_addr = 32 * (ahd->channel - 'A'); | 301 | start_addr = 32 * (ahd->channel - 'A'); |
303 | ahd_write_seeprom(ahd, (u_int16_t *)buffer, start_addr, | 302 | ahd_write_seeprom(ahd, (u_int16_t *)buffer, start_addr, |
304 | sizeof(struct seeprom_config)/2); | 303 | sizeof(struct seeprom_config)/2); |
diff --git a/drivers/scsi/aic7xxx/aic7xxx_93cx6.c b/drivers/scsi/aic7xxx/aic7xxx_93cx6.c index dd11999b77b6..9e85a7ef9c8e 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_93cx6.c +++ b/drivers/scsi/aic7xxx/aic7xxx_93cx6.c | |||
@@ -207,14 +207,14 @@ ahc_read_seeprom(struct seeprom_descriptor *sd, uint16_t *buf, | |||
207 | reset_seeprom(sd); | 207 | reset_seeprom(sd); |
208 | } | 208 | } |
209 | #ifdef AHC_DUMP_EEPROM | 209 | #ifdef AHC_DUMP_EEPROM |
210 | printf("\nSerial EEPROM:\n\t"); | 210 | printk("\nSerial EEPROM:\n\t"); |
211 | for (k = 0; k < count; k = k + 1) { | 211 | for (k = 0; k < count; k = k + 1) { |
212 | if (((k % 8) == 0) && (k != 0)) { | 212 | if (((k % 8) == 0) && (k != 0)) { |
213 | printf ("\n\t"); | 213 | printk(KERN_CONT "\n\t"); |
214 | } | 214 | } |
215 | printf (" 0x%x", buf[k]); | 215 | printk(KERN_CONT " 0x%x", buf[k]); |
216 | } | 216 | } |
217 | printf ("\n"); | 217 | printk(KERN_CONT "\n"); |
218 | #endif | 218 | #endif |
219 | return (1); | 219 | return (1); |
220 | } | 220 | } |
@@ -240,7 +240,7 @@ ahc_write_seeprom(struct seeprom_descriptor *sd, uint16_t *buf, | |||
240 | ewen = &seeprom_long_ewen; | 240 | ewen = &seeprom_long_ewen; |
241 | ewds = &seeprom_long_ewds; | 241 | ewds = &seeprom_long_ewds; |
242 | } else { | 242 | } else { |
243 | printf("ahc_write_seeprom: unsupported seeprom type %d\n", | 243 | printk("ahc_write_seeprom: unsupported seeprom type %d\n", |
244 | sd->sd_chip); | 244 | sd->sd_chip); |
245 | return (0); | 245 | return (0); |
246 | } | 246 | } |
diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c index 45aa728a76b2..3f5a542a7793 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_core.c +++ b/drivers/scsi/aic7xxx/aic7xxx_core.c | |||
@@ -910,7 +910,7 @@ ahc_run_qoutfifo(struct ahc_softc *ahc) | |||
910 | 910 | ||
911 | scb = ahc_lookup_scb(ahc, scb_index); | 911 | scb = ahc_lookup_scb(ahc, scb_index); |
912 | if (scb == NULL) { | 912 | if (scb == NULL) { |
913 | printf("%s: WARNING no command for scb %d " | 913 | printk("%s: WARNING no command for scb %d " |
914 | "(cmdcmplt)\nQOUTPOS = %d\n", | 914 | "(cmdcmplt)\nQOUTPOS = %d\n", |
915 | ahc_name(ahc), scb_index, | 915 | ahc_name(ahc), scb_index, |
916 | (ahc->qoutfifonext - 1) & 0xFF); | 916 | (ahc->qoutfifonext - 1) & 0xFF); |
@@ -964,7 +964,7 @@ ahc_handle_brkadrint(struct ahc_softc *ahc) | |||
964 | error = ahc_inb(ahc, ERROR); | 964 | error = ahc_inb(ahc, ERROR); |
965 | for (i = 0; error != 1 && i < num_errors; i++) | 965 | for (i = 0; error != 1 && i < num_errors; i++) |
966 | error >>= 1; | 966 | error >>= 1; |
967 | printf("%s: brkadrint, %s at seqaddr = 0x%x\n", | 967 | printk("%s: brkadrint, %s at seqaddr = 0x%x\n", |
968 | ahc_name(ahc), ahc_hard_errors[i].errmesg, | 968 | ahc_name(ahc), ahc_hard_errors[i].errmesg, |
969 | ahc_inb(ahc, SEQADDR0) | | 969 | ahc_inb(ahc, SEQADDR0) | |
970 | (ahc_inb(ahc, SEQADDR1) << 8)); | 970 | (ahc_inb(ahc, SEQADDR1) << 8)); |
@@ -1021,7 +1021,7 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat) | |||
1021 | scb = ahc_lookup_scb(ahc, scb_index); | 1021 | scb = ahc_lookup_scb(ahc, scb_index); |
1022 | if (scb == NULL) { | 1022 | if (scb == NULL) { |
1023 | ahc_print_devinfo(ahc, &devinfo); | 1023 | ahc_print_devinfo(ahc, &devinfo); |
1024 | printf("ahc_intr - referenced scb " | 1024 | printk("ahc_intr - referenced scb " |
1025 | "not valid during seqint 0x%x scb(%d)\n", | 1025 | "not valid during seqint 0x%x scb(%d)\n", |
1026 | intstat, scb_index); | 1026 | intstat, scb_index); |
1027 | ahc_dump_card_state(ahc); | 1027 | ahc_dump_card_state(ahc); |
@@ -1049,7 +1049,7 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat) | |||
1049 | ahc_set_scsi_status(scb, hscb->shared_data.status.scsi_status); | 1049 | ahc_set_scsi_status(scb, hscb->shared_data.status.scsi_status); |
1050 | switch (hscb->shared_data.status.scsi_status) { | 1050 | switch (hscb->shared_data.status.scsi_status) { |
1051 | case SCSI_STATUS_OK: | 1051 | case SCSI_STATUS_OK: |
1052 | printf("%s: Interrupted for staus of 0???\n", | 1052 | printk("%s: Interrupted for staus of 0???\n", |
1053 | ahc_name(ahc)); | 1053 | ahc_name(ahc)); |
1054 | break; | 1054 | break; |
1055 | case SCSI_STATUS_CMD_TERMINATED: | 1055 | case SCSI_STATUS_CMD_TERMINATED: |
@@ -1063,7 +1063,7 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat) | |||
1063 | #ifdef AHC_DEBUG | 1063 | #ifdef AHC_DEBUG |
1064 | if (ahc_debug & AHC_SHOW_SENSE) { | 1064 | if (ahc_debug & AHC_SHOW_SENSE) { |
1065 | ahc_print_path(ahc, scb); | 1065 | ahc_print_path(ahc, scb); |
1066 | printf("SCB %d: requests Check Status\n", | 1066 | printk("SCB %d: requests Check Status\n", |
1067 | scb->hscb->tag); | 1067 | scb->hscb->tag); |
1068 | } | 1068 | } |
1069 | #endif | 1069 | #endif |
@@ -1086,7 +1086,7 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat) | |||
1086 | #ifdef AHC_DEBUG | 1086 | #ifdef AHC_DEBUG |
1087 | if (ahc_debug & AHC_SHOW_SENSE) { | 1087 | if (ahc_debug & AHC_SHOW_SENSE) { |
1088 | ahc_print_path(ahc, scb); | 1088 | ahc_print_path(ahc, scb); |
1089 | printf("Sending Sense\n"); | 1089 | printk("Sending Sense\n"); |
1090 | } | 1090 | } |
1091 | #endif | 1091 | #endif |
1092 | sg->addr = ahc_get_sense_bufaddr(ahc, scb); | 1092 | sg->addr = ahc_get_sense_bufaddr(ahc, scb); |
@@ -1162,29 +1162,29 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat) | |||
1162 | ahc_outb(ahc, SCSISEQ, | 1162 | ahc_outb(ahc, SCSISEQ, |
1163 | ahc_inb(ahc, SCSISEQ) & (ENSELI|ENRSELI|ENAUTOATNP)); | 1163 | ahc_inb(ahc, SCSISEQ) & (ENSELI|ENRSELI|ENAUTOATNP)); |
1164 | 1164 | ||
1165 | printf("%s:%c:%d: no active SCB for reconnecting " | 1165 | printk("%s:%c:%d: no active SCB for reconnecting " |
1166 | "target - issuing BUS DEVICE RESET\n", | 1166 | "target - issuing BUS DEVICE RESET\n", |
1167 | ahc_name(ahc), devinfo.channel, devinfo.target); | 1167 | ahc_name(ahc), devinfo.channel, devinfo.target); |
1168 | printf("SAVED_SCSIID == 0x%x, SAVED_LUN == 0x%x, " | 1168 | printk("SAVED_SCSIID == 0x%x, SAVED_LUN == 0x%x, " |
1169 | "ARG_1 == 0x%x ACCUM = 0x%x\n", | 1169 | "ARG_1 == 0x%x ACCUM = 0x%x\n", |
1170 | ahc_inb(ahc, SAVED_SCSIID), ahc_inb(ahc, SAVED_LUN), | 1170 | ahc_inb(ahc, SAVED_SCSIID), ahc_inb(ahc, SAVED_LUN), |
1171 | ahc_inb(ahc, ARG_1), ahc_inb(ahc, ACCUM)); | 1171 | ahc_inb(ahc, ARG_1), ahc_inb(ahc, ACCUM)); |
1172 | printf("SEQ_FLAGS == 0x%x, SCBPTR == 0x%x, BTT == 0x%x, " | 1172 | printk("SEQ_FLAGS == 0x%x, SCBPTR == 0x%x, BTT == 0x%x, " |
1173 | "SINDEX == 0x%x\n", | 1173 | "SINDEX == 0x%x\n", |
1174 | ahc_inb(ahc, SEQ_FLAGS), ahc_inb(ahc, SCBPTR), | 1174 | ahc_inb(ahc, SEQ_FLAGS), ahc_inb(ahc, SCBPTR), |
1175 | ahc_index_busy_tcl(ahc, | 1175 | ahc_index_busy_tcl(ahc, |
1176 | BUILD_TCL(ahc_inb(ahc, SAVED_SCSIID), | 1176 | BUILD_TCL(ahc_inb(ahc, SAVED_SCSIID), |
1177 | ahc_inb(ahc, SAVED_LUN))), | 1177 | ahc_inb(ahc, SAVED_LUN))), |
1178 | ahc_inb(ahc, SINDEX)); | 1178 | ahc_inb(ahc, SINDEX)); |
1179 | printf("SCSIID == 0x%x, SCB_SCSIID == 0x%x, SCB_LUN == 0x%x, " | 1179 | printk("SCSIID == 0x%x, SCB_SCSIID == 0x%x, SCB_LUN == 0x%x, " |
1180 | "SCB_TAG == 0x%x, SCB_CONTROL == 0x%x\n", | 1180 | "SCB_TAG == 0x%x, SCB_CONTROL == 0x%x\n", |
1181 | ahc_inb(ahc, SCSIID), ahc_inb(ahc, SCB_SCSIID), | 1181 | ahc_inb(ahc, SCSIID), ahc_inb(ahc, SCB_SCSIID), |
1182 | ahc_inb(ahc, SCB_LUN), ahc_inb(ahc, SCB_TAG), | 1182 | ahc_inb(ahc, SCB_LUN), ahc_inb(ahc, SCB_TAG), |
1183 | ahc_inb(ahc, SCB_CONTROL)); | 1183 | ahc_inb(ahc, SCB_CONTROL)); |
1184 | printf("SCSIBUSL == 0x%x, SCSISIGI == 0x%x\n", | 1184 | printk("SCSIBUSL == 0x%x, SCSISIGI == 0x%x\n", |
1185 | ahc_inb(ahc, SCSIBUSL), ahc_inb(ahc, SCSISIGI)); | 1185 | ahc_inb(ahc, SCSIBUSL), ahc_inb(ahc, SCSISIGI)); |
1186 | printf("SXFRCTL0 == 0x%x\n", ahc_inb(ahc, SXFRCTL0)); | 1186 | printk("SXFRCTL0 == 0x%x\n", ahc_inb(ahc, SXFRCTL0)); |
1187 | printf("SEQCTL == 0x%x\n", ahc_inb(ahc, SEQCTL)); | 1187 | printk("SEQCTL == 0x%x\n", ahc_inb(ahc, SEQCTL)); |
1188 | ahc_dump_card_state(ahc); | 1188 | ahc_dump_card_state(ahc); |
1189 | ahc->msgout_buf[0] = MSG_BUS_DEV_RESET; | 1189 | ahc->msgout_buf[0] = MSG_BUS_DEV_RESET; |
1190 | ahc->msgout_len = 1; | 1190 | ahc->msgout_len = 1; |
@@ -1197,7 +1197,7 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat) | |||
1197 | case SEND_REJECT: | 1197 | case SEND_REJECT: |
1198 | { | 1198 | { |
1199 | u_int rejbyte = ahc_inb(ahc, ACCUM); | 1199 | u_int rejbyte = ahc_inb(ahc, ACCUM); |
1200 | printf("%s:%c:%d: Warning - unknown message received from " | 1200 | printk("%s:%c:%d: Warning - unknown message received from " |
1201 | "target (0x%x). Rejecting\n", | 1201 | "target (0x%x). Rejecting\n", |
1202 | ahc_name(ahc), devinfo.channel, devinfo.target, rejbyte); | 1202 | ahc_name(ahc), devinfo.channel, devinfo.target, rejbyte); |
1203 | break; | 1203 | break; |
@@ -1218,7 +1218,7 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat) | |||
1218 | u_int lastphase; | 1218 | u_int lastphase; |
1219 | 1219 | ||
1220 | lastphase = ahc_inb(ahc, LASTPHASE); | 1220 | lastphase = ahc_inb(ahc, LASTPHASE); |
1221 | printf("%s:%c:%d: unknown scsi bus phase %x, " | 1221 | printk("%s:%c:%d: unknown scsi bus phase %x, " |
1222 | "lastphase = 0x%x. Attempting to continue\n", | 1222 | "lastphase = 0x%x. Attempting to continue\n", |
1223 | ahc_name(ahc), devinfo.channel, devinfo.target, | 1223 | ahc_name(ahc), devinfo.channel, devinfo.target, |
1224 | lastphase, ahc_inb(ahc, SCSISIGI)); | 1224 | lastphase, ahc_inb(ahc, SCSISIGI)); |
@@ -1229,7 +1229,7 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat) | |||
1229 | u_int lastphase; | 1229 | u_int lastphase; |
1230 | 1230 | ||
1231 | lastphase = ahc_inb(ahc, LASTPHASE); | 1231 | lastphase = ahc_inb(ahc, LASTPHASE); |
1232 | printf("%s:%c:%d: Missed busfree. " | 1232 | printk("%s:%c:%d: Missed busfree. " |
1233 | "Lastphase = 0x%x, Curphase = 0x%x\n", | 1233 | "Lastphase = 0x%x, Curphase = 0x%x\n", |
1234 | ahc_name(ahc), devinfo.channel, devinfo.target, | 1234 | ahc_name(ahc), devinfo.channel, devinfo.target, |
1235 | lastphase, ahc_inb(ahc, SCSISIGI)); | 1235 | lastphase, ahc_inb(ahc, SCSISIGI)); |
@@ -1257,7 +1257,7 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat) | |||
1257 | bus_phase = ahc_inb(ahc, SCSISIGI) & PHASE_MASK; | 1257 | bus_phase = ahc_inb(ahc, SCSISIGI) & PHASE_MASK; |
1258 | if (bus_phase != P_MESGIN | 1258 | if (bus_phase != P_MESGIN |
1259 | && bus_phase != P_MESGOUT) { | 1259 | && bus_phase != P_MESGOUT) { |
1260 | printf("ahc_intr: HOST_MSG_LOOP bad " | 1260 | printk("ahc_intr: HOST_MSG_LOOP bad " |
1261 | "phase 0x%x\n", | 1261 | "phase 0x%x\n", |
1262 | bus_phase); | 1262 | bus_phase); |
1263 | /* | 1263 | /* |
@@ -1359,7 +1359,7 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat) | |||
1359 | u_int scb_index; | 1359 | u_int scb_index; |
1360 | 1360 | ||
1361 | ahc_print_devinfo(ahc, &devinfo); | 1361 | ahc_print_devinfo(ahc, &devinfo); |
1362 | printf("Unable to clear parity error. " | 1362 | printk("Unable to clear parity error. " |
1363 | "Resetting bus.\n"); | 1363 | "Resetting bus.\n"); |
1364 | scb_index = ahc_inb(ahc, SCB_TAG); | 1364 | scb_index = ahc_inb(ahc, SCB_TAG); |
1365 | scb = ahc_lookup_scb(ahc, scb_index); | 1365 | scb = ahc_lookup_scb(ahc, scb_index); |
@@ -1395,18 +1395,18 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat) | |||
1395 | break; | 1395 | break; |
1396 | } | 1396 | } |
1397 | ahc_print_path(ahc, scb); | 1397 | ahc_print_path(ahc, scb); |
1398 | printf("data overrun detected %s." | 1398 | printk("data overrun detected %s." |
1399 | " Tag == 0x%x.\n", | 1399 | " Tag == 0x%x.\n", |
1400 | ahc_phase_table[i].phasemsg, | 1400 | ahc_phase_table[i].phasemsg, |
1401 | scb->hscb->tag); | 1401 | scb->hscb->tag); |
1402 | ahc_print_path(ahc, scb); | 1402 | ahc_print_path(ahc, scb); |
1403 | printf("%s seen Data Phase. Length = %ld. NumSGs = %d.\n", | 1403 | printk("%s seen Data Phase. Length = %ld. NumSGs = %d.\n", |
1404 | ahc_inb(ahc, SEQ_FLAGS) & DPHASE ? "Have" : "Haven't", | 1404 | ahc_inb(ahc, SEQ_FLAGS) & DPHASE ? "Have" : "Haven't", |
1405 | ahc_get_transfer_length(scb), scb->sg_count); | 1405 | ahc_get_transfer_length(scb), scb->sg_count); |
1406 | if (scb->sg_count > 0) { | 1406 | if (scb->sg_count > 0) { |
1407 | for (i = 0; i < scb->sg_count; i++) { | 1407 | for (i = 0; i < scb->sg_count; i++) { |
1408 | 1408 | ||
1409 | printf("sg[%d] - Addr 0x%x%x : Length %d\n", | 1409 | printk("sg[%d] - Addr 0x%x%x : Length %d\n", |
1410 | i, | 1410 | i, |
1411 | (ahc_le32toh(scb->sg_list[i].len) >> 24 | 1411 | (ahc_le32toh(scb->sg_list[i].len) >> 24 |
1412 | & SG_HIGH_ADDR_BITS), | 1412 | & SG_HIGH_ADDR_BITS), |
@@ -1453,7 +1453,7 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat) | |||
1453 | { | 1453 | { |
1454 | u_int scbindex; | 1454 | u_int scbindex; |
1455 | 1455 | ||
1456 | printf("%s:%c:%d:%d: Attempt to issue message failed\n", | 1456 | printk("%s:%c:%d:%d: Attempt to issue message failed\n", |
1457 | ahc_name(ahc), devinfo.channel, devinfo.target, | 1457 | ahc_name(ahc), devinfo.channel, devinfo.target, |
1458 | devinfo.lun); | 1458 | devinfo.lun); |
1459 | scbindex = ahc_inb(ahc, SCB_TAG); | 1459 | scbindex = ahc_inb(ahc, SCB_TAG); |
@@ -1473,7 +1473,7 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat) | |||
1473 | } | 1473 | } |
1474 | case NO_FREE_SCB: | 1474 | case NO_FREE_SCB: |
1475 | { | 1475 | { |
1476 | printf("%s: No free or disconnected SCBs\n", ahc_name(ahc)); | 1476 | printk("%s: No free or disconnected SCBs\n", ahc_name(ahc)); |
1477 | ahc_dump_card_state(ahc); | 1477 | ahc_dump_card_state(ahc); |
1478 | panic("for safety"); | 1478 | panic("for safety"); |
1479 | break; | 1479 | break; |
@@ -1483,7 +1483,7 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat) | |||
1483 | u_int scbptr; | 1483 | u_int scbptr; |
1484 | 1484 | ||
1485 | scbptr = ahc_inb(ahc, SCBPTR); | 1485 | scbptr = ahc_inb(ahc, SCBPTR); |
1486 | printf("Bogus TAG after DMA. SCBPTR %d, tag %d, our tag %d\n", | 1486 | printk("Bogus TAG after DMA. SCBPTR %d, tag %d, our tag %d\n", |
1487 | scbptr, ahc_inb(ahc, ARG_1), | 1487 | scbptr, ahc_inb(ahc, ARG_1), |
1488 | ahc->scb_data->hscbs[scbptr].tag); | 1488 | ahc->scb_data->hscbs[scbptr].tag); |
1489 | ahc_dump_card_state(ahc); | 1489 | ahc_dump_card_state(ahc); |
@@ -1492,12 +1492,12 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat) | |||
1492 | } | 1492 | } |
1493 | case OUT_OF_RANGE: | 1493 | case OUT_OF_RANGE: |
1494 | { | 1494 | { |
1495 | printf("%s: BTT calculation out of range\n", ahc_name(ahc)); | 1495 | printk("%s: BTT calculation out of range\n", ahc_name(ahc)); |
1496 | printf("SAVED_SCSIID == 0x%x, SAVED_LUN == 0x%x, " | 1496 | printk("SAVED_SCSIID == 0x%x, SAVED_LUN == 0x%x, " |
1497 | "ARG_1 == 0x%x ACCUM = 0x%x\n", | 1497 | "ARG_1 == 0x%x ACCUM = 0x%x\n", |
1498 | ahc_inb(ahc, SAVED_SCSIID), ahc_inb(ahc, SAVED_LUN), | 1498 | ahc_inb(ahc, SAVED_SCSIID), ahc_inb(ahc, SAVED_LUN), |
1499 | ahc_inb(ahc, ARG_1), ahc_inb(ahc, ACCUM)); | 1499 | ahc_inb(ahc, ARG_1), ahc_inb(ahc, ACCUM)); |
1500 | printf("SEQ_FLAGS == 0x%x, SCBPTR == 0x%x, BTT == 0x%x, " | 1500 | printk("SEQ_FLAGS == 0x%x, SCBPTR == 0x%x, BTT == 0x%x, " |
1501 | "SINDEX == 0x%x\n, A == 0x%x\n", | 1501 | "SINDEX == 0x%x\n, A == 0x%x\n", |
1502 | ahc_inb(ahc, SEQ_FLAGS), ahc_inb(ahc, SCBPTR), | 1502 | ahc_inb(ahc, SEQ_FLAGS), ahc_inb(ahc, SCBPTR), |
1503 | ahc_index_busy_tcl(ahc, | 1503 | ahc_index_busy_tcl(ahc, |
@@ -1505,19 +1505,19 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat) | |||
1505 | ahc_inb(ahc, SAVED_LUN))), | 1505 | ahc_inb(ahc, SAVED_LUN))), |
1506 | ahc_inb(ahc, SINDEX), | 1506 | ahc_inb(ahc, SINDEX), |
1507 | ahc_inb(ahc, ACCUM)); | 1507 | ahc_inb(ahc, ACCUM)); |
1508 | printf("SCSIID == 0x%x, SCB_SCSIID == 0x%x, SCB_LUN == 0x%x, " | 1508 | printk("SCSIID == 0x%x, SCB_SCSIID == 0x%x, SCB_LUN == 0x%x, " |
1509 | "SCB_TAG == 0x%x, SCB_CONTROL == 0x%x\n", | 1509 | "SCB_TAG == 0x%x, SCB_CONTROL == 0x%x\n", |
1510 | ahc_inb(ahc, SCSIID), ahc_inb(ahc, SCB_SCSIID), | 1510 | ahc_inb(ahc, SCSIID), ahc_inb(ahc, SCB_SCSIID), |
1511 | ahc_inb(ahc, SCB_LUN), ahc_inb(ahc, SCB_TAG), | 1511 | ahc_inb(ahc, SCB_LUN), ahc_inb(ahc, SCB_TAG), |
1512 | ahc_inb(ahc, SCB_CONTROL)); | 1512 | ahc_inb(ahc, SCB_CONTROL)); |
1513 | printf("SCSIBUSL == 0x%x, SCSISIGI == 0x%x\n", | 1513 | printk("SCSIBUSL == 0x%x, SCSISIGI == 0x%x\n", |
1514 | ahc_inb(ahc, SCSIBUSL), ahc_inb(ahc, SCSISIGI)); | 1514 | ahc_inb(ahc, SCSIBUSL), ahc_inb(ahc, SCSISIGI)); |
1515 | ahc_dump_card_state(ahc); | 1515 | ahc_dump_card_state(ahc); |
1516 | panic("for safety"); | 1516 | panic("for safety"); |
1517 | break; | 1517 | break; |
1518 | } | 1518 | } |
1519 | default: | 1519 | default: |
1520 | printf("ahc_intr: seqint, " | 1520 | printk("ahc_intr: seqint, " |
1521 | "intstat == 0x%x, scsisigi = 0x%x\n", | 1521 | "intstat == 0x%x, scsisigi = 0x%x\n", |
1522 | intstat, ahc_inb(ahc, SCSISIGI)); | 1522 | intstat, ahc_inb(ahc, SCSISIGI)); |
1523 | break; | 1523 | break; |
@@ -1562,7 +1562,7 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat) | |||
1562 | intr_channel = (cur_channel == 'A') ? 'B' : 'A'; | 1562 | intr_channel = (cur_channel == 'A') ? 'B' : 'A'; |
1563 | } | 1563 | } |
1564 | if (status == 0) { | 1564 | if (status == 0) { |
1565 | printf("%s: Spurious SCSI interrupt\n", ahc_name(ahc)); | 1565 | printk("%s: Spurious SCSI interrupt\n", ahc_name(ahc)); |
1566 | ahc_outb(ahc, CLRINT, CLRSCSIINT); | 1566 | ahc_outb(ahc, CLRINT, CLRSCSIINT); |
1567 | ahc_unpause(ahc); | 1567 | ahc_unpause(ahc); |
1568 | return; | 1568 | return; |
@@ -1583,7 +1583,7 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat) | |||
1583 | int now_lvd; | 1583 | int now_lvd; |
1584 | 1584 | ||
1585 | now_lvd = ahc_inb(ahc, SBLKCTL) & ENAB40; | 1585 | now_lvd = ahc_inb(ahc, SBLKCTL) & ENAB40; |
1586 | printf("%s: Transceiver State Has Changed to %s mode\n", | 1586 | printk("%s: Transceiver State Has Changed to %s mode\n", |
1587 | ahc_name(ahc), now_lvd ? "LVD" : "SE"); | 1587 | ahc_name(ahc), now_lvd ? "LVD" : "SE"); |
1588 | ahc_outb(ahc, CLRSINT0, CLRIOERR); | 1588 | ahc_outb(ahc, CLRSINT0, CLRIOERR); |
1589 | /* | 1589 | /* |
@@ -1599,7 +1599,7 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat) | |||
1599 | ahc_reset_channel(ahc, intr_channel, | 1599 | ahc_reset_channel(ahc, intr_channel, |
1600 | /*Initiate Reset*/now_lvd == 0); | 1600 | /*Initiate Reset*/now_lvd == 0); |
1601 | } else if ((status & SCSIRSTI) != 0) { | 1601 | } else if ((status & SCSIRSTI) != 0) { |
1602 | printf("%s: Someone reset channel %c\n", | 1602 | printk("%s: Someone reset channel %c\n", |
1603 | ahc_name(ahc), intr_channel); | 1603 | ahc_name(ahc), intr_channel); |
1604 | if (intr_channel != cur_channel) | 1604 | if (intr_channel != cur_channel) |
1605 | ahc_outb(ahc, SBLKCTL, ahc_inb(ahc, SBLKCTL) ^ SELBUSB); | 1605 | ahc_outb(ahc, SBLKCTL, ahc_inb(ahc, SBLKCTL) ^ SELBUSB); |
@@ -1659,26 +1659,26 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat) | |||
1659 | ahc_print_path(ahc, scb); | 1659 | ahc_print_path(ahc, scb); |
1660 | scb->flags |= SCB_TRANSMISSION_ERROR; | 1660 | scb->flags |= SCB_TRANSMISSION_ERROR; |
1661 | } else | 1661 | } else |
1662 | printf("%s:%c:%d: ", ahc_name(ahc), intr_channel, | 1662 | printk("%s:%c:%d: ", ahc_name(ahc), intr_channel, |
1663 | SCSIID_TARGET(ahc, ahc_inb(ahc, SAVED_SCSIID))); | 1663 | SCSIID_TARGET(ahc, ahc_inb(ahc, SAVED_SCSIID))); |
1664 | scsirate = ahc_inb(ahc, SCSIRATE); | 1664 | scsirate = ahc_inb(ahc, SCSIRATE); |
1665 | if (silent == FALSE) { | 1665 | if (silent == FALSE) { |
1666 | printf("parity error detected %s. " | 1666 | printk("parity error detected %s. " |
1667 | "SEQADDR(0x%x) SCSIRATE(0x%x)\n", | 1667 | "SEQADDR(0x%x) SCSIRATE(0x%x)\n", |
1668 | ahc_phase_table[i].phasemsg, | 1668 | ahc_phase_table[i].phasemsg, |
1669 | ahc_inw(ahc, SEQADDR0), | 1669 | ahc_inw(ahc, SEQADDR0), |
1670 | scsirate); | 1670 | scsirate); |
1671 | if ((ahc->features & AHC_DT) != 0) { | 1671 | if ((ahc->features & AHC_DT) != 0) { |
1672 | if ((sstat2 & CRCVALERR) != 0) | 1672 | if ((sstat2 & CRCVALERR) != 0) |
1673 | printf("\tCRC Value Mismatch\n"); | 1673 | printk("\tCRC Value Mismatch\n"); |
1674 | if ((sstat2 & CRCENDERR) != 0) | 1674 | if ((sstat2 & CRCENDERR) != 0) |
1675 | printf("\tNo terminal CRC packet " | 1675 | printk("\tNo terminal CRC packet " |
1676 | "recevied\n"); | 1676 | "recevied\n"); |
1677 | if ((sstat2 & CRCREQERR) != 0) | 1677 | if ((sstat2 & CRCREQERR) != 0) |
1678 | printf("\tIllegal CRC packet " | 1678 | printk("\tIllegal CRC packet " |
1679 | "request\n"); | 1679 | "request\n"); |
1680 | if ((sstat2 & DUAL_EDGE_ERR) != 0) | 1680 | if ((sstat2 & DUAL_EDGE_ERR) != 0) |
1681 | printf("\tUnexpected %sDT Data Phase\n", | 1681 | printk("\tUnexpected %sDT Data Phase\n", |
1682 | (scsirate & SINGLE_EDGE) | 1682 | (scsirate & SINGLE_EDGE) |
1683 | ? "" : "non-"); | 1683 | ? "" : "non-"); |
1684 | } | 1684 | } |
@@ -1746,7 +1746,7 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat) | |||
1746 | 1746 | ||
1747 | scb = ahc_lookup_scb(ahc, scb_index); | 1747 | scb = ahc_lookup_scb(ahc, scb_index); |
1748 | if (scb == NULL) { | 1748 | if (scb == NULL) { |
1749 | printf("%s: ahc_intr - referenced scb not " | 1749 | printk("%s: ahc_intr - referenced scb not " |
1750 | "valid during SELTO scb(%d, %d)\n", | 1750 | "valid during SELTO scb(%d, %d)\n", |
1751 | ahc_name(ahc), scbptr, scb_index); | 1751 | ahc_name(ahc), scbptr, scb_index); |
1752 | ahc_dump_card_state(ahc); | 1752 | ahc_dump_card_state(ahc); |
@@ -1755,7 +1755,7 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat) | |||
1755 | #ifdef AHC_DEBUG | 1755 | #ifdef AHC_DEBUG |
1756 | if ((ahc_debug & AHC_SHOW_SELTO) != 0) { | 1756 | if ((ahc_debug & AHC_SHOW_SELTO) != 0) { |
1757 | ahc_print_path(ahc, scb); | 1757 | ahc_print_path(ahc, scb); |
1758 | printf("Saw Selection Timeout for SCB 0x%x\n", | 1758 | printk("Saw Selection Timeout for SCB 0x%x\n", |
1759 | scb_index); | 1759 | scb_index); |
1760 | } | 1760 | } |
1761 | #endif | 1761 | #endif |
@@ -1831,7 +1831,7 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat) | |||
1831 | == MSG_ABORT_TAG) | 1831 | == MSG_ABORT_TAG) |
1832 | tag = scb->hscb->tag; | 1832 | tag = scb->hscb->tag; |
1833 | ahc_print_path(ahc, scb); | 1833 | ahc_print_path(ahc, scb); |
1834 | printf("SCB %d - Abort%s Completed.\n", | 1834 | printk("SCB %d - Abort%s Completed.\n", |
1835 | scb->hscb->tag, tag == SCB_LIST_NULL ? | 1835 | scb->hscb->tag, tag == SCB_LIST_NULL ? |
1836 | "" : " Tag"); | 1836 | "" : " Tag"); |
1837 | ahc_abort_scbs(ahc, target, channel, | 1837 | ahc_abort_scbs(ahc, target, channel, |
@@ -1934,7 +1934,7 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat) | |||
1934 | * We had not fully identified this connection, | 1934 | * We had not fully identified this connection, |
1935 | * so we cannot abort anything. | 1935 | * so we cannot abort anything. |
1936 | */ | 1936 | */ |
1937 | printf("%s: ", ahc_name(ahc)); | 1937 | printk("%s: ", ahc_name(ahc)); |
1938 | } | 1938 | } |
1939 | for (i = 0; i < num_phases; i++) { | 1939 | for (i = 0; i < num_phases; i++) { |
1940 | if (lastphase == ahc_phase_table[i].phase) | 1940 | if (lastphase == ahc_phase_table[i].phase) |
@@ -1949,7 +1949,7 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat) | |||
1949 | */ | 1949 | */ |
1950 | ahc_force_renegotiation(ahc, &devinfo); | 1950 | ahc_force_renegotiation(ahc, &devinfo); |
1951 | } | 1951 | } |
1952 | printf("Unexpected busfree %s\n" | 1952 | printk("Unexpected busfree %s\n" |
1953 | "SEQADDR == 0x%x\n", | 1953 | "SEQADDR == 0x%x\n", |
1954 | ahc_phase_table[i].phasemsg, | 1954 | ahc_phase_table[i].phasemsg, |
1955 | ahc_inb(ahc, SEQADDR0) | 1955 | ahc_inb(ahc, SEQADDR0) |
@@ -1958,7 +1958,7 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat) | |||
1958 | ahc_outb(ahc, CLRINT, CLRSCSIINT); | 1958 | ahc_outb(ahc, CLRINT, CLRSCSIINT); |
1959 | ahc_restart(ahc); | 1959 | ahc_restart(ahc); |
1960 | } else { | 1960 | } else { |
1961 | printf("%s: Missing case in ahc_handle_scsiint. status = %x\n", | 1961 | printk("%s: Missing case in ahc_handle_scsiint. status = %x\n", |
1962 | ahc_name(ahc), status); | 1962 | ahc_name(ahc), status); |
1963 | ahc_outb(ahc, CLRINT, CLRSCSIINT); | 1963 | ahc_outb(ahc, CLRINT, CLRSCSIINT); |
1964 | } | 1964 | } |
@@ -2025,7 +2025,7 @@ ahc_clear_critical_section(struct ahc_softc *ahc) | |||
2025 | break; | 2025 | break; |
2026 | 2026 | ||
2027 | if (steps > AHC_MAX_STEPS) { | 2027 | if (steps > AHC_MAX_STEPS) { |
2028 | printf("%s: Infinite loop in critical section\n", | 2028 | printk("%s: Infinite loop in critical section\n", |
2029 | ahc_name(ahc)); | 2029 | ahc_name(ahc)); |
2030 | ahc_dump_card_state(ahc); | 2030 | ahc_dump_card_state(ahc); |
2031 | panic("critical section loop"); | 2031 | panic("critical section loop"); |
@@ -2104,23 +2104,23 @@ ahc_print_scb(struct scb *scb) | |||
2104 | 2104 | ||
2105 | struct hardware_scb *hscb = scb->hscb; | 2105 | struct hardware_scb *hscb = scb->hscb; |
2106 | 2106 | ||
2107 | printf("scb:%p control:0x%x scsiid:0x%x lun:%d cdb_len:%d\n", | 2107 | printk("scb:%p control:0x%x scsiid:0x%x lun:%d cdb_len:%d\n", |
2108 | (void *)scb, | 2108 | (void *)scb, |
2109 | hscb->control, | 2109 | hscb->control, |
2110 | hscb->scsiid, | 2110 | hscb->scsiid, |
2111 | hscb->lun, | 2111 | hscb->lun, |
2112 | hscb->cdb_len); | 2112 | hscb->cdb_len); |
2113 | printf("Shared Data: "); | 2113 | printk("Shared Data: "); |
2114 | for (i = 0; i < sizeof(hscb->shared_data.cdb); i++) | 2114 | for (i = 0; i < sizeof(hscb->shared_data.cdb); i++) |
2115 | printf("%#02x", hscb->shared_data.cdb[i]); | 2115 | printk("%#02x", hscb->shared_data.cdb[i]); |
2116 | printf(" dataptr:%#x datacnt:%#x sgptr:%#x tag:%#x\n", | 2116 | printk(" dataptr:%#x datacnt:%#x sgptr:%#x tag:%#x\n", |
2117 | ahc_le32toh(hscb->dataptr), | 2117 | ahc_le32toh(hscb->dataptr), |
2118 | ahc_le32toh(hscb->datacnt), | 2118 | ahc_le32toh(hscb->datacnt), |
2119 | ahc_le32toh(hscb->sgptr), | 2119 | ahc_le32toh(hscb->sgptr), |
2120 | hscb->tag); | 2120 | hscb->tag); |
2121 | if (scb->sg_count > 0) { | 2121 | if (scb->sg_count > 0) { |
2122 | for (i = 0; i < scb->sg_count; i++) { | 2122 | for (i = 0; i < scb->sg_count; i++) { |
2123 | printf("sg[%d] - Addr 0x%x%x : Length %d\n", | 2123 | printk("sg[%d] - Addr 0x%x%x : Length %d\n", |
2124 | i, | 2124 | i, |
2125 | (ahc_le32toh(scb->sg_list[i].len) >> 24 | 2125 | (ahc_le32toh(scb->sg_list[i].len) >> 24 |
2126 | & SG_HIGH_ADDR_BITS), | 2126 | & SG_HIGH_ADDR_BITS), |
@@ -2152,8 +2152,7 @@ ahc_alloc_tstate(struct ahc_softc *ahc, u_int scsi_id, char channel) | |||
2152 | && ahc->enabled_targets[scsi_id] != master_tstate) | 2152 | && ahc->enabled_targets[scsi_id] != master_tstate) |
2153 | panic("%s: ahc_alloc_tstate - Target already allocated", | 2153 | panic("%s: ahc_alloc_tstate - Target already allocated", |
2154 | ahc_name(ahc)); | 2154 | ahc_name(ahc)); |
2155 | tstate = (struct ahc_tmode_tstate*)malloc(sizeof(*tstate), | 2155 | tstate = kmalloc(sizeof(*tstate), GFP_ATOMIC); |
2156 | M_DEVBUF, M_NOWAIT); | ||
2157 | if (tstate == NULL) | 2156 | if (tstate == NULL) |
2158 | return (NULL); | 2157 | return (NULL); |
2159 | 2158 | ||
@@ -2202,7 +2201,7 @@ ahc_free_tstate(struct ahc_softc *ahc, u_int scsi_id, char channel, int force) | |||
2202 | scsi_id += 8; | 2201 | scsi_id += 8; |
2203 | tstate = ahc->enabled_targets[scsi_id]; | 2202 | tstate = ahc->enabled_targets[scsi_id]; |
2204 | if (tstate != NULL) | 2203 | if (tstate != NULL) |
2205 | free(tstate, M_DEVBUF); | 2204 | kfree(tstate); |
2206 | ahc->enabled_targets[scsi_id] = NULL; | 2205 | ahc->enabled_targets[scsi_id] = NULL; |
2207 | } | 2206 | } |
2208 | #endif | 2207 | #endif |
@@ -2589,13 +2588,13 @@ ahc_set_syncrate(struct ahc_softc *ahc, struct ahc_devinfo *devinfo, | |||
2589 | CAM_LUN_WILDCARD, AC_TRANSFER_NEG); | 2588 | CAM_LUN_WILDCARD, AC_TRANSFER_NEG); |
2590 | if (bootverbose) { | 2589 | if (bootverbose) { |
2591 | if (offset != 0) { | 2590 | if (offset != 0) { |
2592 | printf("%s: target %d synchronous at %sMHz%s, " | 2591 | printk("%s: target %d synchronous at %sMHz%s, " |
2593 | "offset = 0x%x\n", ahc_name(ahc), | 2592 | "offset = 0x%x\n", ahc_name(ahc), |
2594 | devinfo->target, syncrate->rate, | 2593 | devinfo->target, syncrate->rate, |
2595 | (ppr_options & MSG_EXT_PPR_DT_REQ) | 2594 | (ppr_options & MSG_EXT_PPR_DT_REQ) |
2596 | ? " DT" : "", offset); | 2595 | ? " DT" : "", offset); |
2597 | } else { | 2596 | } else { |
2598 | printf("%s: target %d using " | 2597 | printk("%s: target %d using " |
2599 | "asynchronous transfers\n", | 2598 | "asynchronous transfers\n", |
2600 | ahc_name(ahc), devinfo->target); | 2599 | ahc_name(ahc), devinfo->target); |
2601 | } | 2600 | } |
@@ -2658,7 +2657,7 @@ ahc_set_width(struct ahc_softc *ahc, struct ahc_devinfo *devinfo, | |||
2658 | ahc_send_async(ahc, devinfo->channel, devinfo->target, | 2657 | ahc_send_async(ahc, devinfo->channel, devinfo->target, |
2659 | CAM_LUN_WILDCARD, AC_TRANSFER_NEG); | 2658 | CAM_LUN_WILDCARD, AC_TRANSFER_NEG); |
2660 | if (bootverbose) { | 2659 | if (bootverbose) { |
2661 | printf("%s: target %d using %dbit transfers\n", | 2660 | printk("%s: target %d using %dbit transfers\n", |
2662 | ahc_name(ahc), devinfo->target, | 2661 | ahc_name(ahc), devinfo->target, |
2663 | 8 * (0x01 << width)); | 2662 | 8 * (0x01 << width)); |
2664 | } | 2663 | } |
@@ -2835,7 +2834,7 @@ ahc_compile_devinfo(struct ahc_devinfo *devinfo, u_int our_id, u_int target, | |||
2835 | void | 2834 | void |
2836 | ahc_print_devinfo(struct ahc_softc *ahc, struct ahc_devinfo *devinfo) | 2835 | ahc_print_devinfo(struct ahc_softc *ahc, struct ahc_devinfo *devinfo) |
2837 | { | 2836 | { |
2838 | printf("%s:%c:%d:%d: ", ahc_name(ahc), devinfo->channel, | 2837 | printk("%s:%c:%d:%d: ", ahc_name(ahc), devinfo->channel, |
2839 | devinfo->target, devinfo->lun); | 2838 | devinfo->target, devinfo->lun); |
2840 | } | 2839 | } |
2841 | 2840 | ||
@@ -2907,7 +2906,7 @@ ahc_setup_initiator_msgout(struct ahc_softc *ahc, struct ahc_devinfo *devinfo, | |||
2907 | ahc->msgout_buf[ahc->msgout_index++] = MSG_BUS_DEV_RESET; | 2906 | ahc->msgout_buf[ahc->msgout_index++] = MSG_BUS_DEV_RESET; |
2908 | ahc->msgout_len++; | 2907 | ahc->msgout_len++; |
2909 | ahc_print_path(ahc, scb); | 2908 | ahc_print_path(ahc, scb); |
2910 | printf("Bus Device Reset Message Sent\n"); | 2909 | printk("Bus Device Reset Message Sent\n"); |
2911 | /* | 2910 | /* |
2912 | * Clear our selection hardware in advance of | 2911 | * Clear our selection hardware in advance of |
2913 | * the busfree. We may have an entry in the waiting | 2912 | * the busfree. We may have an entry in the waiting |
@@ -2923,7 +2922,7 @@ ahc_setup_initiator_msgout(struct ahc_softc *ahc, struct ahc_devinfo *devinfo, | |||
2923 | ahc->msgout_buf[ahc->msgout_index++] = MSG_ABORT; | 2922 | ahc->msgout_buf[ahc->msgout_index++] = MSG_ABORT; |
2924 | ahc->msgout_len++; | 2923 | ahc->msgout_len++; |
2925 | ahc_print_path(ahc, scb); | 2924 | ahc_print_path(ahc, scb); |
2926 | printf("Abort%s Message Sent\n", | 2925 | printk("Abort%s Message Sent\n", |
2927 | (scb->hscb->control & TAG_ENB) != 0 ? " Tag" : ""); | 2926 | (scb->hscb->control & TAG_ENB) != 0 ? " Tag" : ""); |
2928 | /* | 2927 | /* |
2929 | * Clear our selection hardware in advance of | 2928 | * Clear our selection hardware in advance of |
@@ -2936,9 +2935,9 @@ ahc_setup_initiator_msgout(struct ahc_softc *ahc, struct ahc_devinfo *devinfo, | |||
2936 | } else if ((scb->flags & (SCB_AUTO_NEGOTIATE|SCB_NEGOTIATE)) != 0) { | 2935 | } else if ((scb->flags & (SCB_AUTO_NEGOTIATE|SCB_NEGOTIATE)) != 0) { |
2937 | ahc_build_transfer_msg(ahc, devinfo); | 2936 | ahc_build_transfer_msg(ahc, devinfo); |
2938 | } else { | 2937 | } else { |
2939 | printf("ahc_intr: AWAITING_MSG for an SCB that " | 2938 | printk("ahc_intr: AWAITING_MSG for an SCB that " |
2940 | "does not have a waiting message\n"); | 2939 | "does not have a waiting message\n"); |
2941 | printf("SCSIID = %x, target_mask = %x\n", scb->hscb->scsiid, | 2940 | printk("SCSIID = %x, target_mask = %x\n", scb->hscb->scsiid, |
2942 | devinfo->target_mask); | 2941 | devinfo->target_mask); |
2943 | panic("SCB = %d, SCB Control = %x, MSG_OUT = %x " | 2942 | panic("SCB = %d, SCB Control = %x, MSG_OUT = %x " |
2944 | "SCB flags = %x", scb->hscb->tag, scb->hscb->control, | 2943 | "SCB flags = %x", scb->hscb->tag, scb->hscb->control, |
@@ -3019,7 +3018,7 @@ ahc_build_transfer_msg(struct ahc_softc *ahc, struct ahc_devinfo *devinfo) | |||
3019 | 3018 | ||
3020 | if (bootverbose) { | 3019 | if (bootverbose) { |
3021 | ahc_print_devinfo(ahc, devinfo); | 3020 | ahc_print_devinfo(ahc, devinfo); |
3022 | printf("Ensuring async\n"); | 3021 | printk("Ensuring async\n"); |
3023 | } | 3022 | } |
3024 | } | 3023 | } |
3025 | 3024 | ||
@@ -3067,7 +3066,7 @@ ahc_construct_sdtr(struct ahc_softc *ahc, struct ahc_devinfo *devinfo, | |||
3067 | ahc->msgout_buf + ahc->msgout_index, period, offset); | 3066 | ahc->msgout_buf + ahc->msgout_index, period, offset); |
3068 | ahc->msgout_len += 5; | 3067 | ahc->msgout_len += 5; |
3069 | if (bootverbose) { | 3068 | if (bootverbose) { |
3070 | printf("(%s:%c:%d:%d): Sending SDTR period %x, offset %x\n", | 3069 | printk("(%s:%c:%d:%d): Sending SDTR period %x, offset %x\n", |
3071 | ahc_name(ahc), devinfo->channel, devinfo->target, | 3070 | ahc_name(ahc), devinfo->channel, devinfo->target, |
3072 | devinfo->lun, period, offset); | 3071 | devinfo->lun, period, offset); |
3073 | } | 3072 | } |
@@ -3085,7 +3084,7 @@ ahc_construct_wdtr(struct ahc_softc *ahc, struct ahc_devinfo *devinfo, | |||
3085 | ahc->msgout_buf + ahc->msgout_index, bus_width); | 3084 | ahc->msgout_buf + ahc->msgout_index, bus_width); |
3086 | ahc->msgout_len += 4; | 3085 | ahc->msgout_len += 4; |
3087 | if (bootverbose) { | 3086 | if (bootverbose) { |
3088 | printf("(%s:%c:%d:%d): Sending WDTR %x\n", | 3087 | printk("(%s:%c:%d:%d): Sending WDTR %x\n", |
3089 | ahc_name(ahc), devinfo->channel, devinfo->target, | 3088 | ahc_name(ahc), devinfo->channel, devinfo->target, |
3090 | devinfo->lun, bus_width); | 3089 | devinfo->lun, bus_width); |
3091 | } | 3090 | } |
@@ -3107,7 +3106,7 @@ ahc_construct_ppr(struct ahc_softc *ahc, struct ahc_devinfo *devinfo, | |||
3107 | bus_width, ppr_options); | 3106 | bus_width, ppr_options); |
3108 | ahc->msgout_len += 8; | 3107 | ahc->msgout_len += 8; |
3109 | if (bootverbose) { | 3108 | if (bootverbose) { |
3110 | printf("(%s:%c:%d:%d): Sending PPR bus_width %x, period %x, " | 3109 | printk("(%s:%c:%d:%d): Sending PPR bus_width %x, period %x, " |
3111 | "offset %x, ppr_options %x\n", ahc_name(ahc), | 3110 | "offset %x, ppr_options %x\n", ahc_name(ahc), |
3112 | devinfo->channel, devinfo->target, devinfo->lun, | 3111 | devinfo->channel, devinfo->target, devinfo->lun, |
3113 | bus_width, period, offset, ppr_options); | 3112 | bus_width, period, offset, ppr_options); |
@@ -3160,7 +3159,7 @@ ahc_handle_proto_violation(struct ahc_softc *ahc) | |||
3160 | * to match. | 3159 | * to match. |
3161 | */ | 3160 | */ |
3162 | ahc_print_devinfo(ahc, &devinfo); | 3161 | ahc_print_devinfo(ahc, &devinfo); |
3163 | printf("Target did not send an IDENTIFY message. " | 3162 | printk("Target did not send an IDENTIFY message. " |
3164 | "LASTPHASE = 0x%x.\n", lastphase); | 3163 | "LASTPHASE = 0x%x.\n", lastphase); |
3165 | scb = NULL; | 3164 | scb = NULL; |
3166 | } else if (scb == NULL) { | 3165 | } else if (scb == NULL) { |
@@ -3169,13 +3168,13 @@ ahc_handle_proto_violation(struct ahc_softc *ahc) | |||
3169 | * transaction. Print an error and reset the bus. | 3168 | * transaction. Print an error and reset the bus. |
3170 | */ | 3169 | */ |
3171 | ahc_print_devinfo(ahc, &devinfo); | 3170 | ahc_print_devinfo(ahc, &devinfo); |
3172 | printf("No SCB found during protocol violation\n"); | 3171 | printk("No SCB found during protocol violation\n"); |
3173 | goto proto_violation_reset; | 3172 | goto proto_violation_reset; |
3174 | } else { | 3173 | } else { |
3175 | ahc_set_transaction_status(scb, CAM_SEQUENCE_FAIL); | 3174 | ahc_set_transaction_status(scb, CAM_SEQUENCE_FAIL); |
3176 | if ((seq_flags & NO_CDB_SENT) != 0) { | 3175 | if ((seq_flags & NO_CDB_SENT) != 0) { |
3177 | ahc_print_path(ahc, scb); | 3176 | ahc_print_path(ahc, scb); |
3178 | printf("No or incomplete CDB sent to device.\n"); | 3177 | printk("No or incomplete CDB sent to device.\n"); |
3179 | } else if ((ahc_inb(ahc, SCB_CONTROL) & STATUS_RCVD) == 0) { | 3178 | } else if ((ahc_inb(ahc, SCB_CONTROL) & STATUS_RCVD) == 0) { |
3180 | /* | 3179 | /* |
3181 | * The target never bothered to provide status to | 3180 | * The target never bothered to provide status to |
@@ -3185,10 +3184,10 @@ ahc_handle_proto_violation(struct ahc_softc *ahc) | |||
3185 | * message. | 3184 | * message. |
3186 | */ | 3185 | */ |
3187 | ahc_print_path(ahc, scb); | 3186 | ahc_print_path(ahc, scb); |
3188 | printf("Completed command without status.\n"); | 3187 | printk("Completed command without status.\n"); |
3189 | } else { | 3188 | } else { |
3190 | ahc_print_path(ahc, scb); | 3189 | ahc_print_path(ahc, scb); |
3191 | printf("Unknown protocol violation.\n"); | 3190 | printk("Unknown protocol violation.\n"); |
3192 | ahc_dump_card_state(ahc); | 3191 | ahc_dump_card_state(ahc); |
3193 | } | 3192 | } |
3194 | } | 3193 | } |
@@ -3202,7 +3201,7 @@ proto_violation_reset: | |||
3202 | * it away with a bus reset. | 3201 | * it away with a bus reset. |
3203 | */ | 3202 | */ |
3204 | found = ahc_reset_channel(ahc, 'A', TRUE); | 3203 | found = ahc_reset_channel(ahc, 'A', TRUE); |
3205 | printf("%s: Issued Channel %c Bus Reset. " | 3204 | printk("%s: Issued Channel %c Bus Reset. " |
3206 | "%d SCBs aborted\n", ahc_name(ahc), 'A', found); | 3205 | "%d SCBs aborted\n", ahc_name(ahc), 'A', found); |
3207 | } else { | 3206 | } else { |
3208 | /* | 3207 | /* |
@@ -3224,7 +3223,7 @@ proto_violation_reset: | |||
3224 | ahc_print_path(ahc, scb); | 3223 | ahc_print_path(ahc, scb); |
3225 | scb->flags |= SCB_ABORT; | 3224 | scb->flags |= SCB_ABORT; |
3226 | } | 3225 | } |
3227 | printf("Protocol violation %s. Attempting to abort.\n", | 3226 | printk("Protocol violation %s. Attempting to abort.\n", |
3228 | ahc_lookup_phase_entry(curphase)->phasemsg); | 3227 | ahc_lookup_phase_entry(curphase)->phasemsg); |
3229 | } | 3228 | } |
3230 | } | 3229 | } |
@@ -3257,14 +3256,14 @@ reswitch: | |||
3257 | #ifdef AHC_DEBUG | 3256 | #ifdef AHC_DEBUG |
3258 | if ((ahc_debug & AHC_SHOW_MESSAGES) != 0) { | 3257 | if ((ahc_debug & AHC_SHOW_MESSAGES) != 0) { |
3259 | ahc_print_devinfo(ahc, &devinfo); | 3258 | ahc_print_devinfo(ahc, &devinfo); |
3260 | printf("INITIATOR_MSG_OUT"); | 3259 | printk("INITIATOR_MSG_OUT"); |
3261 | } | 3260 | } |
3262 | #endif | 3261 | #endif |
3263 | phasemis = bus_phase != P_MESGOUT; | 3262 | phasemis = bus_phase != P_MESGOUT; |
3264 | if (phasemis) { | 3263 | if (phasemis) { |
3265 | #ifdef AHC_DEBUG | 3264 | #ifdef AHC_DEBUG |
3266 | if ((ahc_debug & AHC_SHOW_MESSAGES) != 0) { | 3265 | if ((ahc_debug & AHC_SHOW_MESSAGES) != 0) { |
3267 | printf(" PHASEMIS %s\n", | 3266 | printk(" PHASEMIS %s\n", |
3268 | ahc_lookup_phase_entry(bus_phase) | 3267 | ahc_lookup_phase_entry(bus_phase) |
3269 | ->phasemsg); | 3268 | ->phasemsg); |
3270 | } | 3269 | } |
@@ -3291,7 +3290,7 @@ reswitch: | |||
3291 | ahc_outb(ahc, CLRSINT1, CLRREQINIT); | 3290 | ahc_outb(ahc, CLRSINT1, CLRREQINIT); |
3292 | #ifdef AHC_DEBUG | 3291 | #ifdef AHC_DEBUG |
3293 | if ((ahc_debug & AHC_SHOW_MESSAGES) != 0) | 3292 | if ((ahc_debug & AHC_SHOW_MESSAGES) != 0) |
3294 | printf(" byte 0x%x\n", ahc->send_msg_perror); | 3293 | printk(" byte 0x%x\n", ahc->send_msg_perror); |
3295 | #endif | 3294 | #endif |
3296 | ahc_outb(ahc, SCSIDATL, MSG_PARITY_ERROR); | 3295 | ahc_outb(ahc, SCSIDATL, MSG_PARITY_ERROR); |
3297 | break; | 3296 | break; |
@@ -3321,7 +3320,7 @@ reswitch: | |||
3321 | ahc_outb(ahc, CLRSINT1, CLRREQINIT); | 3320 | ahc_outb(ahc, CLRSINT1, CLRREQINIT); |
3322 | #ifdef AHC_DEBUG | 3321 | #ifdef AHC_DEBUG |
3323 | if ((ahc_debug & AHC_SHOW_MESSAGES) != 0) | 3322 | if ((ahc_debug & AHC_SHOW_MESSAGES) != 0) |
3324 | printf(" byte 0x%x\n", | 3323 | printk(" byte 0x%x\n", |
3325 | ahc->msgout_buf[ahc->msgout_index]); | 3324 | ahc->msgout_buf[ahc->msgout_index]); |
3326 | #endif | 3325 | #endif |
3327 | ahc_outb(ahc, SCSIDATL, ahc->msgout_buf[ahc->msgout_index++]); | 3326 | ahc_outb(ahc, SCSIDATL, ahc->msgout_buf[ahc->msgout_index++]); |
@@ -3335,14 +3334,14 @@ reswitch: | |||
3335 | #ifdef AHC_DEBUG | 3334 | #ifdef AHC_DEBUG |
3336 | if ((ahc_debug & AHC_SHOW_MESSAGES) != 0) { | 3335 | if ((ahc_debug & AHC_SHOW_MESSAGES) != 0) { |
3337 | ahc_print_devinfo(ahc, &devinfo); | 3336 | ahc_print_devinfo(ahc, &devinfo); |
3338 | printf("INITIATOR_MSG_IN"); | 3337 | printk("INITIATOR_MSG_IN"); |
3339 | } | 3338 | } |
3340 | #endif | 3339 | #endif |
3341 | phasemis = bus_phase != P_MESGIN; | 3340 | phasemis = bus_phase != P_MESGIN; |
3342 | if (phasemis) { | 3341 | if (phasemis) { |
3343 | #ifdef AHC_DEBUG | 3342 | #ifdef AHC_DEBUG |
3344 | if ((ahc_debug & AHC_SHOW_MESSAGES) != 0) { | 3343 | if ((ahc_debug & AHC_SHOW_MESSAGES) != 0) { |
3345 | printf(" PHASEMIS %s\n", | 3344 | printk(" PHASEMIS %s\n", |
3346 | ahc_lookup_phase_entry(bus_phase) | 3345 | ahc_lookup_phase_entry(bus_phase) |
3347 | ->phasemsg); | 3346 | ->phasemsg); |
3348 | } | 3347 | } |
@@ -3363,7 +3362,7 @@ reswitch: | |||
3363 | ahc->msgin_buf[ahc->msgin_index] = ahc_inb(ahc, SCSIBUSL); | 3362 | ahc->msgin_buf[ahc->msgin_index] = ahc_inb(ahc, SCSIBUSL); |
3364 | #ifdef AHC_DEBUG | 3363 | #ifdef AHC_DEBUG |
3365 | if ((ahc_debug & AHC_SHOW_MESSAGES) != 0) | 3364 | if ((ahc_debug & AHC_SHOW_MESSAGES) != 0) |
3366 | printf(" byte 0x%x\n", | 3365 | printk(" byte 0x%x\n", |
3367 | ahc->msgin_buf[ahc->msgin_index]); | 3366 | ahc->msgin_buf[ahc->msgin_index]); |
3368 | #endif | 3367 | #endif |
3369 | 3368 | ||
@@ -3385,7 +3384,7 @@ reswitch: | |||
3385 | #ifdef AHC_DEBUG | 3384 | #ifdef AHC_DEBUG |
3386 | if ((ahc_debug & AHC_SHOW_MESSAGES) != 0) { | 3385 | if ((ahc_debug & AHC_SHOW_MESSAGES) != 0) { |
3387 | ahc_print_devinfo(ahc, &devinfo); | 3386 | ahc_print_devinfo(ahc, &devinfo); |
3388 | printf("Asserting ATN for response\n"); | 3387 | printk("Asserting ATN for response\n"); |
3389 | } | 3388 | } |
3390 | #endif | 3389 | #endif |
3391 | ahc_assert_atn(ahc); | 3390 | ahc_assert_atn(ahc); |
@@ -3666,7 +3665,7 @@ ahc_parse_msg(struct ahc_softc *ahc, struct ahc_devinfo *devinfo) | |||
3666 | targ_scsirate & WIDEXFER, | 3665 | targ_scsirate & WIDEXFER, |
3667 | devinfo->role); | 3666 | devinfo->role); |
3668 | if (bootverbose) { | 3667 | if (bootverbose) { |
3669 | printf("(%s:%c:%d:%d): Received " | 3668 | printk("(%s:%c:%d:%d): Received " |
3670 | "SDTR period %x, offset %x\n\t" | 3669 | "SDTR period %x, offset %x\n\t" |
3671 | "Filtered to period %x, offset %x\n", | 3670 | "Filtered to period %x, offset %x\n", |
3672 | ahc_name(ahc), devinfo->channel, | 3671 | ahc_name(ahc), devinfo->channel, |
@@ -3697,7 +3696,7 @@ ahc_parse_msg(struct ahc_softc *ahc, struct ahc_devinfo *devinfo) | |||
3697 | */ | 3696 | */ |
3698 | if (bootverbose | 3697 | if (bootverbose |
3699 | && devinfo->role == ROLE_INITIATOR) { | 3698 | && devinfo->role == ROLE_INITIATOR) { |
3700 | printf("(%s:%c:%d:%d): Target " | 3699 | printk("(%s:%c:%d:%d): Target " |
3701 | "Initiated SDTR\n", | 3700 | "Initiated SDTR\n", |
3702 | ahc_name(ahc), devinfo->channel, | 3701 | ahc_name(ahc), devinfo->channel, |
3703 | devinfo->target, devinfo->lun); | 3702 | devinfo->target, devinfo->lun); |
@@ -3739,7 +3738,7 @@ ahc_parse_msg(struct ahc_softc *ahc, struct ahc_devinfo *devinfo) | |||
3739 | ahc_validate_width(ahc, tinfo, &bus_width, | 3738 | ahc_validate_width(ahc, tinfo, &bus_width, |
3740 | devinfo->role); | 3739 | devinfo->role); |
3741 | if (bootverbose) { | 3740 | if (bootverbose) { |
3742 | printf("(%s:%c:%d:%d): Received WDTR " | 3741 | printk("(%s:%c:%d:%d): Received WDTR " |
3743 | "%x filtered to %x\n", | 3742 | "%x filtered to %x\n", |
3744 | ahc_name(ahc), devinfo->channel, | 3743 | ahc_name(ahc), devinfo->channel, |
3745 | devinfo->target, devinfo->lun, | 3744 | devinfo->target, devinfo->lun, |
@@ -3755,7 +3754,7 @@ ahc_parse_msg(struct ahc_softc *ahc, struct ahc_devinfo *devinfo) | |||
3755 | */ | 3754 | */ |
3756 | if (saved_width > bus_width) { | 3755 | if (saved_width > bus_width) { |
3757 | reject = TRUE; | 3756 | reject = TRUE; |
3758 | printf("(%s:%c:%d:%d): requested %dBit " | 3757 | printk("(%s:%c:%d:%d): requested %dBit " |
3759 | "transfers. Rejecting...\n", | 3758 | "transfers. Rejecting...\n", |
3760 | ahc_name(ahc), devinfo->channel, | 3759 | ahc_name(ahc), devinfo->channel, |
3761 | devinfo->target, devinfo->lun, | 3760 | devinfo->target, devinfo->lun, |
@@ -3768,7 +3767,7 @@ ahc_parse_msg(struct ahc_softc *ahc, struct ahc_devinfo *devinfo) | |||
3768 | */ | 3767 | */ |
3769 | if (bootverbose | 3768 | if (bootverbose |
3770 | && devinfo->role == ROLE_INITIATOR) { | 3769 | && devinfo->role == ROLE_INITIATOR) { |
3771 | printf("(%s:%c:%d:%d): Target " | 3770 | printk("(%s:%c:%d:%d): Target " |
3772 | "Initiated WDTR\n", | 3771 | "Initiated WDTR\n", |
3773 | ahc_name(ahc), devinfo->channel, | 3772 | ahc_name(ahc), devinfo->channel, |
3774 | devinfo->target, devinfo->lun); | 3773 | devinfo->target, devinfo->lun); |
@@ -3886,12 +3885,12 @@ ahc_parse_msg(struct ahc_softc *ahc, struct ahc_devinfo *devinfo) | |||
3886 | } | 3885 | } |
3887 | } else { | 3886 | } else { |
3888 | if (devinfo->role != ROLE_TARGET) | 3887 | if (devinfo->role != ROLE_TARGET) |
3889 | printf("(%s:%c:%d:%d): Target " | 3888 | printk("(%s:%c:%d:%d): Target " |
3890 | "Initiated PPR\n", | 3889 | "Initiated PPR\n", |
3891 | ahc_name(ahc), devinfo->channel, | 3890 | ahc_name(ahc), devinfo->channel, |
3892 | devinfo->target, devinfo->lun); | 3891 | devinfo->target, devinfo->lun); |
3893 | else | 3892 | else |
3894 | printf("(%s:%c:%d:%d): Initiator " | 3893 | printk("(%s:%c:%d:%d): Initiator " |
3895 | "Initiated PPR\n", | 3894 | "Initiated PPR\n", |
3896 | ahc_name(ahc), devinfo->channel, | 3895 | ahc_name(ahc), devinfo->channel, |
3897 | devinfo->target, devinfo->lun); | 3896 | devinfo->target, devinfo->lun); |
@@ -3903,7 +3902,7 @@ ahc_parse_msg(struct ahc_softc *ahc, struct ahc_devinfo *devinfo) | |||
3903 | response = TRUE; | 3902 | response = TRUE; |
3904 | } | 3903 | } |
3905 | if (bootverbose) { | 3904 | if (bootverbose) { |
3906 | printf("(%s:%c:%d:%d): Received PPR width %x, " | 3905 | printk("(%s:%c:%d:%d): Received PPR width %x, " |
3907 | "period %x, offset %x,options %x\n" | 3906 | "period %x, offset %x,options %x\n" |
3908 | "\tFiltered to width %x, period %x, " | 3907 | "\tFiltered to width %x, period %x, " |
3909 | "offset %x, options %x\n", | 3908 | "offset %x, options %x\n", |
@@ -4033,7 +4032,7 @@ ahc_handle_msg_reject(struct ahc_softc *ahc, struct ahc_devinfo *devinfo) | |||
4033 | * Attempt to negotiate SPI-2 style. | 4032 | * Attempt to negotiate SPI-2 style. |
4034 | */ | 4033 | */ |
4035 | if (bootverbose) { | 4034 | if (bootverbose) { |
4036 | printf("(%s:%c:%d:%d): PPR Rejected. " | 4035 | printk("(%s:%c:%d:%d): PPR Rejected. " |
4037 | "Trying WDTR/SDTR\n", | 4036 | "Trying WDTR/SDTR\n", |
4038 | ahc_name(ahc), devinfo->channel, | 4037 | ahc_name(ahc), devinfo->channel, |
4039 | devinfo->target, devinfo->lun); | 4038 | devinfo->target, devinfo->lun); |
@@ -4049,7 +4048,7 @@ ahc_handle_msg_reject(struct ahc_softc *ahc, struct ahc_devinfo *devinfo) | |||
4049 | } else if (ahc_sent_msg(ahc, AHCMSG_EXT, MSG_EXT_WDTR, /*full*/FALSE)) { | 4048 | } else if (ahc_sent_msg(ahc, AHCMSG_EXT, MSG_EXT_WDTR, /*full*/FALSE)) { |
4050 | 4049 | ||
4051 | /* note 8bit xfers */ | 4050 | /* note 8bit xfers */ |
4052 | printf("(%s:%c:%d:%d): refuses WIDE negotiation. Using " | 4051 | printk("(%s:%c:%d:%d): refuses WIDE negotiation. Using " |
4053 | "8bit transfers\n", ahc_name(ahc), | 4052 | "8bit transfers\n", ahc_name(ahc), |
4054 | devinfo->channel, devinfo->target, devinfo->lun); | 4053 | devinfo->channel, devinfo->target, devinfo->lun); |
4055 | ahc_set_width(ahc, devinfo, MSG_EXT_WDTR_BUS_8_BIT, | 4054 | ahc_set_width(ahc, devinfo, MSG_EXT_WDTR_BUS_8_BIT, |
@@ -4077,7 +4076,7 @@ ahc_handle_msg_reject(struct ahc_softc *ahc, struct ahc_devinfo *devinfo) | |||
4077 | /*offset*/0, /*ppr_options*/0, | 4076 | /*offset*/0, /*ppr_options*/0, |
4078 | AHC_TRANS_ACTIVE|AHC_TRANS_GOAL, | 4077 | AHC_TRANS_ACTIVE|AHC_TRANS_GOAL, |
4079 | /*paused*/TRUE); | 4078 | /*paused*/TRUE); |
4080 | printf("(%s:%c:%d:%d): refuses synchronous negotiation. " | 4079 | printk("(%s:%c:%d:%d): refuses synchronous negotiation. " |
4081 | "Using asynchronous transfers\n", | 4080 | "Using asynchronous transfers\n", |
4082 | ahc_name(ahc), devinfo->channel, | 4081 | ahc_name(ahc), devinfo->channel, |
4083 | devinfo->target, devinfo->lun); | 4082 | devinfo->target, devinfo->lun); |
@@ -4088,13 +4087,13 @@ ahc_handle_msg_reject(struct ahc_softc *ahc, struct ahc_devinfo *devinfo) | |||
4088 | tag_type = (scb->hscb->control & MSG_SIMPLE_TASK); | 4087 | tag_type = (scb->hscb->control & MSG_SIMPLE_TASK); |
4089 | 4088 | ||
4090 | if (tag_type == MSG_SIMPLE_TASK) { | 4089 | if (tag_type == MSG_SIMPLE_TASK) { |
4091 | printf("(%s:%c:%d:%d): refuses tagged commands. " | 4090 | printk("(%s:%c:%d:%d): refuses tagged commands. " |
4092 | "Performing non-tagged I/O\n", ahc_name(ahc), | 4091 | "Performing non-tagged I/O\n", ahc_name(ahc), |
4093 | devinfo->channel, devinfo->target, devinfo->lun); | 4092 | devinfo->channel, devinfo->target, devinfo->lun); |
4094 | ahc_set_tags(ahc, scb->io_ctx, devinfo, AHC_QUEUE_NONE); | 4093 | ahc_set_tags(ahc, scb->io_ctx, devinfo, AHC_QUEUE_NONE); |
4095 | mask = ~0x23; | 4094 | mask = ~0x23; |
4096 | } else { | 4095 | } else { |
4097 | printf("(%s:%c:%d:%d): refuses %s tagged commands. " | 4096 | printk("(%s:%c:%d:%d): refuses %s tagged commands. " |
4098 | "Performing simple queue tagged I/O only\n", | 4097 | "Performing simple queue tagged I/O only\n", |
4099 | ahc_name(ahc), devinfo->channel, devinfo->target, | 4098 | ahc_name(ahc), devinfo->channel, devinfo->target, |
4100 | devinfo->lun, tag_type == MSG_ORDERED_TASK | 4099 | devinfo->lun, tag_type == MSG_ORDERED_TASK |
@@ -4144,7 +4143,7 @@ ahc_handle_msg_reject(struct ahc_softc *ahc, struct ahc_devinfo *devinfo) | |||
4144 | /* | 4143 | /* |
4145 | * Otherwise, we ignore it. | 4144 | * Otherwise, we ignore it. |
4146 | */ | 4145 | */ |
4147 | printf("%s:%c:%d: Message reject for %x -- ignored\n", | 4146 | printk("%s:%c:%d: Message reject for %x -- ignored\n", |
4148 | ahc_name(ahc), devinfo->channel, devinfo->target, | 4147 | ahc_name(ahc), devinfo->channel, devinfo->target, |
4149 | last_msg); | 4148 | last_msg); |
4150 | } | 4149 | } |
@@ -4369,7 +4368,7 @@ ahc_handle_devreset(struct ahc_softc *ahc, struct ahc_devinfo *devinfo, | |||
4369 | 4368 | ||
4370 | if (message != NULL | 4369 | if (message != NULL |
4371 | && (verbose_level <= bootverbose)) | 4370 | && (verbose_level <= bootverbose)) |
4372 | printf("%s: %s on %c:%d. %d SCBs aborted\n", ahc_name(ahc), | 4371 | printk("%s: %s on %c:%d. %d SCBs aborted\n", ahc_name(ahc), |
4373 | message, devinfo->channel, devinfo->target, found); | 4372 | message, devinfo->channel, devinfo->target, found); |
4374 | } | 4373 | } |
4375 | 4374 | ||
@@ -4408,23 +4407,22 @@ ahc_alloc(void *platform_arg, char *name) | |||
4408 | int i; | 4407 | int i; |
4409 | 4408 | ||
4410 | #ifndef __FreeBSD__ | 4409 | #ifndef __FreeBSD__ |
4411 | ahc = malloc(sizeof(*ahc), M_DEVBUF, M_NOWAIT); | 4410 | ahc = kmalloc(sizeof(*ahc), GFP_ATOMIC); |
4412 | if (!ahc) { | 4411 | if (!ahc) { |
4413 | printf("aic7xxx: cannot malloc softc!\n"); | 4412 | printk("aic7xxx: cannot malloc softc!\n"); |
4414 | free(name, M_DEVBUF); | 4413 | kfree(name); |
4415 | return NULL; | 4414 | return NULL; |
4416 | } | 4415 | } |
4417 | #else | 4416 | #else |
4418 | ahc = device_get_softc((device_t)platform_arg); | 4417 | ahc = device_get_softc((device_t)platform_arg); |
4419 | #endif | 4418 | #endif |
4420 | memset(ahc, 0, sizeof(*ahc)); | 4419 | memset(ahc, 0, sizeof(*ahc)); |
4421 | ahc->seep_config = malloc(sizeof(*ahc->seep_config), | 4420 | ahc->seep_config = kmalloc(sizeof(*ahc->seep_config), GFP_ATOMIC); |
4422 | M_DEVBUF, M_NOWAIT); | ||
4423 | if (ahc->seep_config == NULL) { | 4421 | if (ahc->seep_config == NULL) { |
4424 | #ifndef __FreeBSD__ | 4422 | #ifndef __FreeBSD__ |
4425 | free(ahc, M_DEVBUF); | 4423 | kfree(ahc); |
4426 | #endif | 4424 | #endif |
4427 | free(name, M_DEVBUF); | 4425 | kfree(name); |
4428 | return (NULL); | 4426 | return (NULL); |
4429 | } | 4427 | } |
4430 | LIST_INIT(&ahc->pending_scbs); | 4428 | LIST_INIT(&ahc->pending_scbs); |
@@ -4466,8 +4464,7 @@ ahc_softc_init(struct ahc_softc *ahc) | |||
4466 | ahc->pause = ahc->unpause | PAUSE; | 4464 | ahc->pause = ahc->unpause | PAUSE; |
4467 | /* XXX The shared scb data stuff should be deprecated */ | 4465 | /* XXX The shared scb data stuff should be deprecated */ |
4468 | if (ahc->scb_data == NULL) { | 4466 | if (ahc->scb_data == NULL) { |
4469 | ahc->scb_data = malloc(sizeof(*ahc->scb_data), | 4467 | ahc->scb_data = kmalloc(sizeof(*ahc->scb_data), GFP_ATOMIC); |
4470 | M_DEVBUF, M_NOWAIT); | ||
4471 | if (ahc->scb_data == NULL) | 4468 | if (ahc->scb_data == NULL) |
4472 | return (ENOMEM); | 4469 | return (ENOMEM); |
4473 | memset(ahc->scb_data, 0, sizeof(*ahc->scb_data)); | 4470 | memset(ahc->scb_data, 0, sizeof(*ahc->scb_data)); |
@@ -4486,7 +4483,7 @@ void | |||
4486 | ahc_set_name(struct ahc_softc *ahc, char *name) | 4483 | ahc_set_name(struct ahc_softc *ahc, char *name) |
4487 | { | 4484 | { |
4488 | if (ahc->name != NULL) | 4485 | if (ahc->name != NULL) |
4489 | free(ahc->name, M_DEVBUF); | 4486 | kfree(ahc->name); |
4490 | ahc->name = name; | 4487 | ahc->name = name; |
4491 | } | 4488 | } |
4492 | 4489 | ||
@@ -4540,25 +4537,25 @@ ahc_free(struct ahc_softc *ahc) | |||
4540 | lstate = tstate->enabled_luns[j]; | 4537 | lstate = tstate->enabled_luns[j]; |
4541 | if (lstate != NULL) { | 4538 | if (lstate != NULL) { |
4542 | xpt_free_path(lstate->path); | 4539 | xpt_free_path(lstate->path); |
4543 | free(lstate, M_DEVBUF); | 4540 | kfree(lstate); |
4544 | } | 4541 | } |
4545 | } | 4542 | } |
4546 | #endif | 4543 | #endif |
4547 | free(tstate, M_DEVBUF); | 4544 | kfree(tstate); |
4548 | } | 4545 | } |
4549 | } | 4546 | } |
4550 | #ifdef AHC_TARGET_MODE | 4547 | #ifdef AHC_TARGET_MODE |
4551 | if (ahc->black_hole != NULL) { | 4548 | if (ahc->black_hole != NULL) { |
4552 | xpt_free_path(ahc->black_hole->path); | 4549 | xpt_free_path(ahc->black_hole->path); |
4553 | free(ahc->black_hole, M_DEVBUF); | 4550 | kfree(ahc->black_hole); |
4554 | } | 4551 | } |
4555 | #endif | 4552 | #endif |
4556 | if (ahc->name != NULL) | 4553 | if (ahc->name != NULL) |
4557 | free(ahc->name, M_DEVBUF); | 4554 | kfree(ahc->name); |
4558 | if (ahc->seep_config != NULL) | 4555 | if (ahc->seep_config != NULL) |
4559 | free(ahc->seep_config, M_DEVBUF); | 4556 | kfree(ahc->seep_config); |
4560 | #ifndef __FreeBSD__ | 4557 | #ifndef __FreeBSD__ |
4561 | free(ahc, M_DEVBUF); | 4558 | kfree(ahc); |
4562 | #endif | 4559 | #endif |
4563 | return; | 4560 | return; |
4564 | } | 4561 | } |
@@ -4633,7 +4630,7 @@ ahc_reset(struct ahc_softc *ahc, int reinit) | |||
4633 | } while (--wait && !(ahc_inb(ahc, HCNTRL) & CHIPRSTACK)); | 4630 | } while (--wait && !(ahc_inb(ahc, HCNTRL) & CHIPRSTACK)); |
4634 | 4631 | ||
4635 | if (wait == 0) { | 4632 | if (wait == 0) { |
4636 | printf("%s: WARNING - Failed chip reset! " | 4633 | printk("%s: WARNING - Failed chip reset! " |
4637 | "Trying to initialize anyway.\n", ahc_name(ahc)); | 4634 | "Trying to initialize anyway.\n", ahc_name(ahc)); |
4638 | } | 4635 | } |
4639 | ahc_outb(ahc, HCNTRL, ahc->pause); | 4636 | ahc_outb(ahc, HCNTRL, ahc->pause); |
@@ -4656,7 +4653,7 @@ ahc_reset(struct ahc_softc *ahc, int reinit) | |||
4656 | ahc->features |= AHC_TWIN; | 4653 | ahc->features |= AHC_TWIN; |
4657 | break; | 4654 | break; |
4658 | default: | 4655 | default: |
4659 | printf(" Unsupported adapter type. Ignoring\n"); | 4656 | printk(" Unsupported adapter type. Ignoring\n"); |
4660 | return(-1); | 4657 | return(-1); |
4661 | } | 4658 | } |
4662 | 4659 | ||
@@ -4783,9 +4780,7 @@ ahc_init_scbdata(struct ahc_softc *ahc) | |||
4783 | SLIST_INIT(&scb_data->sg_maps); | 4780 | SLIST_INIT(&scb_data->sg_maps); |
4784 | 4781 | ||
4785 | /* Allocate SCB resources */ | 4782 | /* Allocate SCB resources */ |
4786 | scb_data->scbarray = | 4783 | scb_data->scbarray = (struct scb *)kmalloc(sizeof(struct scb) * AHC_SCB_MAX_ALLOC, GFP_ATOMIC); |
4787 | (struct scb *)malloc(sizeof(struct scb) * AHC_SCB_MAX_ALLOC, | ||
4788 | M_DEVBUF, M_NOWAIT); | ||
4789 | if (scb_data->scbarray == NULL) | 4784 | if (scb_data->scbarray == NULL) |
4790 | return (ENOMEM); | 4785 | return (ENOMEM); |
4791 | memset(scb_data->scbarray, 0, sizeof(struct scb) * AHC_SCB_MAX_ALLOC); | 4786 | memset(scb_data->scbarray, 0, sizeof(struct scb) * AHC_SCB_MAX_ALLOC); |
@@ -4794,7 +4789,7 @@ ahc_init_scbdata(struct ahc_softc *ahc) | |||
4794 | 4789 | ||
4795 | scb_data->maxhscbs = ahc_probe_scbs(ahc); | 4790 | scb_data->maxhscbs = ahc_probe_scbs(ahc); |
4796 | if (ahc->scb_data->maxhscbs == 0) { | 4791 | if (ahc->scb_data->maxhscbs == 0) { |
4797 | printf("%s: No SCB space found\n", ahc_name(ahc)); | 4792 | printk("%s: No SCB space found\n", ahc_name(ahc)); |
4798 | return (ENXIO); | 4793 | return (ENXIO); |
4799 | } | 4794 | } |
4800 | 4795 | ||
@@ -4892,7 +4887,7 @@ ahc_init_scbdata(struct ahc_softc *ahc) | |||
4892 | ahc_alloc_scbs(ahc); | 4887 | ahc_alloc_scbs(ahc); |
4893 | 4888 | ||
4894 | if (scb_data->numscbs == 0) { | 4889 | if (scb_data->numscbs == 0) { |
4895 | printf("%s: ahc_init_scbdata - " | 4890 | printk("%s: ahc_init_scbdata - " |
4896 | "Unable to allocate initial scbs\n", | 4891 | "Unable to allocate initial scbs\n", |
4897 | ahc_name(ahc)); | 4892 | ahc_name(ahc)); |
4898 | goto error_exit; | 4893 | goto error_exit; |
@@ -4935,7 +4930,7 @@ ahc_fini_scbdata(struct ahc_softc *ahc) | |||
4935 | ahc_dmamem_free(ahc, scb_data->sg_dmat, | 4930 | ahc_dmamem_free(ahc, scb_data->sg_dmat, |
4936 | sg_map->sg_vaddr, | 4931 | sg_map->sg_vaddr, |
4937 | sg_map->sg_dmamap); | 4932 | sg_map->sg_dmamap); |
4938 | free(sg_map, M_DEVBUF); | 4933 | kfree(sg_map); |
4939 | } | 4934 | } |
4940 | ahc_dma_tag_destroy(ahc, scb_data->sg_dmat); | 4935 | ahc_dma_tag_destroy(ahc, scb_data->sg_dmat); |
4941 | } | 4936 | } |
@@ -4964,7 +4959,7 @@ ahc_fini_scbdata(struct ahc_softc *ahc) | |||
4964 | break; | 4959 | break; |
4965 | } | 4960 | } |
4966 | if (scb_data->scbarray != NULL) | 4961 | if (scb_data->scbarray != NULL) |
4967 | free(scb_data->scbarray, M_DEVBUF); | 4962 | kfree(scb_data->scbarray); |
4968 | } | 4963 | } |
4969 | 4964 | ||
4970 | static void | 4965 | static void |
@@ -4985,7 +4980,7 @@ ahc_alloc_scbs(struct ahc_softc *ahc) | |||
4985 | 4980 | ||
4986 | next_scb = &scb_data->scbarray[scb_data->numscbs]; | 4981 | next_scb = &scb_data->scbarray[scb_data->numscbs]; |
4987 | 4982 | ||
4988 | sg_map = malloc(sizeof(*sg_map), M_DEVBUF, M_NOWAIT); | 4983 | sg_map = kmalloc(sizeof(*sg_map), GFP_ATOMIC); |
4989 | 4984 | ||
4990 | if (sg_map == NULL) | 4985 | if (sg_map == NULL) |
4991 | return; | 4986 | return; |
@@ -4994,7 +4989,7 @@ ahc_alloc_scbs(struct ahc_softc *ahc) | |||
4994 | if (ahc_dmamem_alloc(ahc, scb_data->sg_dmat, | 4989 | if (ahc_dmamem_alloc(ahc, scb_data->sg_dmat, |
4995 | (void **)&sg_map->sg_vaddr, | 4990 | (void **)&sg_map->sg_vaddr, |
4996 | BUS_DMA_NOWAIT, &sg_map->sg_dmamap) != 0) { | 4991 | BUS_DMA_NOWAIT, &sg_map->sg_dmamap) != 0) { |
4997 | free(sg_map, M_DEVBUF); | 4992 | kfree(sg_map); |
4998 | return; | 4993 | return; |
4999 | } | 4994 | } |
5000 | 4995 | ||
@@ -5014,8 +5009,7 @@ ahc_alloc_scbs(struct ahc_softc *ahc) | |||
5014 | #ifndef __linux__ | 5009 | #ifndef __linux__ |
5015 | int error; | 5010 | int error; |
5016 | #endif | 5011 | #endif |
5017 | pdata = (struct scb_platform_data *)malloc(sizeof(*pdata), | 5012 | pdata = kmalloc(sizeof(*pdata), GFP_ATOMIC); |
5018 | M_DEVBUF, M_NOWAIT); | ||
5019 | if (pdata == NULL) | 5013 | if (pdata == NULL) |
5020 | break; | 5014 | break; |
5021 | next_scb->platform_data = pdata; | 5015 | next_scb->platform_data = pdata; |
@@ -5244,7 +5238,7 @@ ahc_chip_init(struct ahc_softc *ahc) | |||
5244 | * in "fast" mode. | 5238 | * in "fast" mode. |
5245 | */ | 5239 | */ |
5246 | if (bootverbose) | 5240 | if (bootverbose) |
5247 | printf("%s: Downloading Sequencer Program...", | 5241 | printk("%s: Downloading Sequencer Program...", |
5248 | ahc_name(ahc)); | 5242 | ahc_name(ahc)); |
5249 | 5243 | ||
5250 | error = ahc_loadseq(ahc); | 5244 | error = ahc_loadseq(ahc); |
@@ -5290,22 +5284,22 @@ ahc_init(struct ahc_softc *ahc) | |||
5290 | #endif | 5284 | #endif |
5291 | 5285 | ||
5292 | #ifdef AHC_PRINT_SRAM | 5286 | #ifdef AHC_PRINT_SRAM |
5293 | printf("Scratch Ram:"); | 5287 | printk("Scratch Ram:"); |
5294 | for (i = 0x20; i < 0x5f; i++) { | 5288 | for (i = 0x20; i < 0x5f; i++) { |
5295 | if (((i % 8) == 0) && (i != 0)) { | 5289 | if (((i % 8) == 0) && (i != 0)) { |
5296 | printf ("\n "); | 5290 | printk ("\n "); |
5297 | } | 5291 | } |
5298 | printf (" 0x%x", ahc_inb(ahc, i)); | 5292 | printk (" 0x%x", ahc_inb(ahc, i)); |
5299 | } | 5293 | } |
5300 | if ((ahc->features & AHC_MORE_SRAM) != 0) { | 5294 | if ((ahc->features & AHC_MORE_SRAM) != 0) { |
5301 | for (i = 0x70; i < 0x7f; i++) { | 5295 | for (i = 0x70; i < 0x7f; i++) { |
5302 | if (((i % 8) == 0) && (i != 0)) { | 5296 | if (((i % 8) == 0) && (i != 0)) { |
5303 | printf ("\n "); | 5297 | printk ("\n "); |
5304 | } | 5298 | } |
5305 | printf (" 0x%x", ahc_inb(ahc, i)); | 5299 | printk (" 0x%x", ahc_inb(ahc, i)); |
5306 | } | 5300 | } |
5307 | } | 5301 | } |
5308 | printf ("\n"); | 5302 | printk ("\n"); |
5309 | /* | 5303 | /* |
5310 | * Reading uninitialized scratch ram may | 5304 | * Reading uninitialized scratch ram may |
5311 | * generate parity errors. | 5305 | * generate parity errors. |
@@ -5419,14 +5413,14 @@ ahc_init(struct ahc_softc *ahc) | |||
5419 | * data for any target mode initiator. | 5413 | * data for any target mode initiator. |
5420 | */ | 5414 | */ |
5421 | if (ahc_alloc_tstate(ahc, ahc->our_id, 'A') == NULL) { | 5415 | if (ahc_alloc_tstate(ahc, ahc->our_id, 'A') == NULL) { |
5422 | printf("%s: unable to allocate ahc_tmode_tstate. " | 5416 | printk("%s: unable to allocate ahc_tmode_tstate. " |
5423 | "Failing attach\n", ahc_name(ahc)); | 5417 | "Failing attach\n", ahc_name(ahc)); |
5424 | return (ENOMEM); | 5418 | return (ENOMEM); |
5425 | } | 5419 | } |
5426 | 5420 | ||
5427 | if ((ahc->features & AHC_TWIN) != 0) { | 5421 | if ((ahc->features & AHC_TWIN) != 0) { |
5428 | if (ahc_alloc_tstate(ahc, ahc->our_id_b, 'B') == NULL) { | 5422 | if (ahc_alloc_tstate(ahc, ahc->our_id_b, 'B') == NULL) { |
5429 | printf("%s: unable to allocate ahc_tmode_tstate. " | 5423 | printk("%s: unable to allocate ahc_tmode_tstate. " |
5430 | "Failing attach\n", ahc_name(ahc)); | 5424 | "Failing attach\n", ahc_name(ahc)); |
5431 | return (ENOMEM); | 5425 | return (ENOMEM); |
5432 | } | 5426 | } |
@@ -5440,7 +5434,7 @@ ahc_init(struct ahc_softc *ahc) | |||
5440 | 5434 | ||
5441 | #ifdef AHC_DEBUG | 5435 | #ifdef AHC_DEBUG |
5442 | if (ahc_debug & AHC_SHOW_MISC) { | 5436 | if (ahc_debug & AHC_SHOW_MISC) { |
5443 | printf("%s: hardware scb %u bytes; kernel scb %u bytes; " | 5437 | printk("%s: hardware scb %u bytes; kernel scb %u bytes; " |
5444 | "ahc_dma %u bytes\n", | 5438 | "ahc_dma %u bytes\n", |
5445 | ahc_name(ahc), | 5439 | ahc_name(ahc), |
5446 | (u_int)sizeof(struct hardware_scb), | 5440 | (u_int)sizeof(struct hardware_scb), |
@@ -5470,7 +5464,7 @@ ahc_init(struct ahc_softc *ahc) | |||
5470 | 5464 | ||
5471 | /* Grab the disconnection disable table and invert it for our needs */ | 5465 | /* Grab the disconnection disable table and invert it for our needs */ |
5472 | if ((ahc->flags & AHC_USEDEFAULTS) != 0) { | 5466 | if ((ahc->flags & AHC_USEDEFAULTS) != 0) { |
5473 | printf("%s: Host Adapter Bios disabled. Using default SCSI " | 5467 | printk("%s: Host Adapter Bios disabled. Using default SCSI " |
5474 | "device parameters\n", ahc_name(ahc)); | 5468 | "device parameters\n", ahc_name(ahc)); |
5475 | ahc->flags |= AHC_EXTENDED_TRANS_A|AHC_EXTENDED_TRANS_B| | 5469 | ahc->flags |= AHC_EXTENDED_TRANS_A|AHC_EXTENDED_TRANS_B| |
5476 | AHC_TERM_ENB_A|AHC_TERM_ENB_B; | 5470 | AHC_TERM_ENB_A|AHC_TERM_ENB_B; |
@@ -5651,7 +5645,7 @@ ahc_pause_and_flushwork(struct ahc_softc *ahc) | |||
5651 | && ((intstat & INT_PEND) != 0 | 5645 | && ((intstat & INT_PEND) != 0 |
5652 | || (ahc_inb(ahc, SSTAT0) & (SELDO|SELINGO)) != 0)); | 5646 | || (ahc_inb(ahc, SSTAT0) & (SELDO|SELINGO)) != 0)); |
5653 | if (maxloops == 0) { | 5647 | if (maxloops == 0) { |
5654 | printf("Infinite interrupt loop, INTSTAT = %x", | 5648 | printk("Infinite interrupt loop, INTSTAT = %x", |
5655 | ahc_inb(ahc, INTSTAT)); | 5649 | ahc_inb(ahc, INTSTAT)); |
5656 | } | 5650 | } |
5657 | ahc_platform_flushwork(ahc); | 5651 | ahc_platform_flushwork(ahc); |
@@ -5910,7 +5904,7 @@ ahc_search_qinfifo(struct ahc_softc *ahc, int target, char channel, | |||
5910 | while (qinpos != qintail) { | 5904 | while (qinpos != qintail) { |
5911 | scb = ahc_lookup_scb(ahc, ahc->qinfifo[qinpos]); | 5905 | scb = ahc_lookup_scb(ahc, ahc->qinfifo[qinpos]); |
5912 | if (scb == NULL) { | 5906 | if (scb == NULL) { |
5913 | printf("qinpos = %d, SCB index = %d\n", | 5907 | printk("qinpos = %d, SCB index = %d\n", |
5914 | qinpos, ahc->qinfifo[qinpos]); | 5908 | qinpos, ahc->qinfifo[qinpos]); |
5915 | panic("Loop 1\n"); | 5909 | panic("Loop 1\n"); |
5916 | } | 5910 | } |
@@ -5933,7 +5927,7 @@ ahc_search_qinfifo(struct ahc_softc *ahc, int target, char channel, | |||
5933 | if (cstat != CAM_REQ_CMP) | 5927 | if (cstat != CAM_REQ_CMP) |
5934 | ahc_freeze_scb(scb); | 5928 | ahc_freeze_scb(scb); |
5935 | if ((scb->flags & SCB_ACTIVE) == 0) | 5929 | if ((scb->flags & SCB_ACTIVE) == 0) |
5936 | printf("Inactive SCB in qinfifo\n"); | 5930 | printk("Inactive SCB in qinfifo\n"); |
5937 | ahc_done(ahc, scb); | 5931 | ahc_done(ahc, scb); |
5938 | 5932 | ||
5939 | /* FALLTHROUGH */ | 5933 | /* FALLTHROUGH */ |
@@ -5976,7 +5970,7 @@ ahc_search_qinfifo(struct ahc_softc *ahc, int target, char channel, | |||
5976 | scb = ahc_lookup_scb(ahc, ahc->qinfifo[qinstart]); | 5970 | scb = ahc_lookup_scb(ahc, ahc->qinfifo[qinstart]); |
5977 | 5971 | ||
5978 | if (scb == NULL) { | 5972 | if (scb == NULL) { |
5979 | printf("found = %d, qinstart = %d, qinfifionext = %d\n", | 5973 | printk("found = %d, qinstart = %d, qinfifionext = %d\n", |
5980 | found, qinstart, ahc->qinfifonext); | 5974 | found, qinstart, ahc->qinfifonext); |
5981 | panic("First/Second Qinfifo fixup\n"); | 5975 | panic("First/Second Qinfifo fixup\n"); |
5982 | } | 5976 | } |
@@ -6014,7 +6008,7 @@ ahc_search_qinfifo(struct ahc_softc *ahc, int target, char channel, | |||
6014 | ahc_outb(ahc, SCBPTR, next); | 6008 | ahc_outb(ahc, SCBPTR, next); |
6015 | scb_index = ahc_inb(ahc, SCB_TAG); | 6009 | scb_index = ahc_inb(ahc, SCB_TAG); |
6016 | if (scb_index >= ahc->scb_data->numscbs) { | 6010 | if (scb_index >= ahc->scb_data->numscbs) { |
6017 | printf("Waiting List inconsistency. " | 6011 | printk("Waiting List inconsistency. " |
6018 | "SCB index == %d, yet numscbs == %d.", | 6012 | "SCB index == %d, yet numscbs == %d.", |
6019 | scb_index, ahc->scb_data->numscbs); | 6013 | scb_index, ahc->scb_data->numscbs); |
6020 | ahc_dump_card_state(ahc); | 6014 | ahc_dump_card_state(ahc); |
@@ -6022,7 +6016,7 @@ ahc_search_qinfifo(struct ahc_softc *ahc, int target, char channel, | |||
6022 | } | 6016 | } |
6023 | scb = ahc_lookup_scb(ahc, scb_index); | 6017 | scb = ahc_lookup_scb(ahc, scb_index); |
6024 | if (scb == NULL) { | 6018 | if (scb == NULL) { |
6025 | printf("scb_index = %d, next = %d\n", | 6019 | printk("scb_index = %d, next = %d\n", |
6026 | scb_index, next); | 6020 | scb_index, next); |
6027 | panic("Waiting List traversal\n"); | 6021 | panic("Waiting List traversal\n"); |
6028 | } | 6022 | } |
@@ -6046,7 +6040,7 @@ ahc_search_qinfifo(struct ahc_softc *ahc, int target, char channel, | |||
6046 | if (cstat != CAM_REQ_CMP) | 6040 | if (cstat != CAM_REQ_CMP) |
6047 | ahc_freeze_scb(scb); | 6041 | ahc_freeze_scb(scb); |
6048 | if ((scb->flags & SCB_ACTIVE) == 0) | 6042 | if ((scb->flags & SCB_ACTIVE) == 0) |
6049 | printf("Inactive SCB in Waiting List\n"); | 6043 | printk("Inactive SCB in Waiting List\n"); |
6050 | ahc_done(ahc, scb); | 6044 | ahc_done(ahc, scb); |
6051 | /* FALLTHROUGH */ | 6045 | /* FALLTHROUGH */ |
6052 | } | 6046 | } |
@@ -6153,7 +6147,7 @@ ahc_search_untagged_queues(struct ahc_softc *ahc, ahc_io_ctx_t ctx, | |||
6153 | if (cstat != CAM_REQ_CMP) | 6147 | if (cstat != CAM_REQ_CMP) |
6154 | ahc_freeze_scb(scb); | 6148 | ahc_freeze_scb(scb); |
6155 | if ((scb->flags & SCB_ACTIVE) == 0) | 6149 | if ((scb->flags & SCB_ACTIVE) == 0) |
6156 | printf("Inactive SCB in untaggedQ\n"); | 6150 | printk("Inactive SCB in untaggedQ\n"); |
6157 | ahc_done(ahc, scb); | 6151 | ahc_done(ahc, scb); |
6158 | break; | 6152 | break; |
6159 | } | 6153 | } |
@@ -6200,7 +6194,7 @@ ahc_search_disc_list(struct ahc_softc *ahc, int target, char channel, | |||
6200 | ahc_outb(ahc, SCBPTR, next); | 6194 | ahc_outb(ahc, SCBPTR, next); |
6201 | scb_index = ahc_inb(ahc, SCB_TAG); | 6195 | scb_index = ahc_inb(ahc, SCB_TAG); |
6202 | if (scb_index >= ahc->scb_data->numscbs) { | 6196 | if (scb_index >= ahc->scb_data->numscbs) { |
6203 | printf("Disconnected List inconsistency. " | 6197 | printk("Disconnected List inconsistency. " |
6204 | "SCB index == %d, yet numscbs == %d.", | 6198 | "SCB index == %d, yet numscbs == %d.", |
6205 | scb_index, ahc->scb_data->numscbs); | 6199 | scb_index, ahc->scb_data->numscbs); |
6206 | ahc_dump_card_state(ahc); | 6200 | ahc_dump_card_state(ahc); |
@@ -6456,7 +6450,7 @@ ahc_abort_scbs(struct ahc_softc *ahc, int target, char channel, | |||
6456 | if (ahc_get_transaction_status(scbp) != CAM_REQ_CMP) | 6450 | if (ahc_get_transaction_status(scbp) != CAM_REQ_CMP) |
6457 | ahc_freeze_scb(scbp); | 6451 | ahc_freeze_scb(scbp); |
6458 | if ((scbp->flags & SCB_ACTIVE) == 0) | 6452 | if ((scbp->flags & SCB_ACTIVE) == 0) |
6459 | printf("Inactive SCB on pending list\n"); | 6453 | printk("Inactive SCB on pending list\n"); |
6460 | ahc_done(ahc, scbp); | 6454 | ahc_done(ahc, scbp); |
6461 | found++; | 6455 | found++; |
6462 | } | 6456 | } |
@@ -6734,7 +6728,7 @@ ahc_calc_residual(struct ahc_softc *ahc, struct scb *scb) | |||
6734 | #ifdef AHC_DEBUG | 6728 | #ifdef AHC_DEBUG |
6735 | if ((ahc_debug & AHC_SHOW_MISC) != 0) { | 6729 | if ((ahc_debug & AHC_SHOW_MISC) != 0) { |
6736 | ahc_print_path(ahc, scb); | 6730 | ahc_print_path(ahc, scb); |
6737 | printf("Handled %sResidual of %d bytes\n", | 6731 | printk("Handled %sResidual of %d bytes\n", |
6738 | (scb->flags & SCB_SENSE) ? "Sense " : "", resid); | 6732 | (scb->flags & SCB_SENSE) ? "Sense " : "", resid); |
6739 | } | 6733 | } |
6740 | #endif | 6734 | #endif |
@@ -6774,7 +6768,7 @@ ahc_queue_lstate_event(struct ahc_softc *ahc, struct ahc_tmode_lstate *lstate, | |||
6774 | 6768 | ||
6775 | if (pending == AHC_TMODE_EVENT_BUFFER_SIZE) { | 6769 | if (pending == AHC_TMODE_EVENT_BUFFER_SIZE) { |
6776 | xpt_print_path(lstate->path); | 6770 | xpt_print_path(lstate->path); |
6777 | printf("immediate event %x:%x lost\n", | 6771 | printk("immediate event %x:%x lost\n", |
6778 | lstate->event_buffer[lstate->event_r_idx].event_type, | 6772 | lstate->event_buffer[lstate->event_r_idx].event_type, |
6779 | lstate->event_buffer[lstate->event_r_idx].event_arg); | 6773 | lstate->event_buffer[lstate->event_r_idx].event_arg); |
6780 | lstate->event_r_idx++; | 6774 | lstate->event_r_idx++; |
@@ -6844,7 +6838,7 @@ ahc_dumpseq(struct ahc_softc* ahc) | |||
6844 | uint8_t ins_bytes[4]; | 6838 | uint8_t ins_bytes[4]; |
6845 | 6839 | ||
6846 | ahc_insb(ahc, SEQRAM, ins_bytes, 4); | 6840 | ahc_insb(ahc, SEQRAM, ins_bytes, 4); |
6847 | printf("0x%08x\n", ins_bytes[0] << 24 | 6841 | printk("0x%08x\n", ins_bytes[0] << 24 |
6848 | | ins_bytes[1] << 16 | 6842 | | ins_bytes[1] << 16 |
6849 | | ins_bytes[2] << 8 | 6843 | | ins_bytes[2] << 8 |
6850 | | ins_bytes[3]); | 6844 | | ins_bytes[3]); |
@@ -6912,7 +6906,7 @@ ahc_loadseq(struct ahc_softc *ahc) | |||
6912 | * storage capacity for this chip. Fail | 6906 | * storage capacity for this chip. Fail |
6913 | * the load. | 6907 | * the load. |
6914 | */ | 6908 | */ |
6915 | printf("\n%s: Program too large for instruction memory " | 6909 | printk("\n%s: Program too large for instruction memory " |
6916 | "size of %d!\n", ahc_name(ahc), | 6910 | "size of %d!\n", ahc_name(ahc), |
6917 | ahc->instruction_ram_size); | 6911 | ahc->instruction_ram_size); |
6918 | return (ENOMEM); | 6912 | return (ENOMEM); |
@@ -6947,7 +6941,7 @@ ahc_loadseq(struct ahc_softc *ahc) | |||
6947 | if (cs_count != 0) { | 6941 | if (cs_count != 0) { |
6948 | 6942 | ||
6949 | cs_count *= sizeof(struct cs); | 6943 | cs_count *= sizeof(struct cs); |
6950 | ahc->critical_sections = malloc(cs_count, M_DEVBUF, M_NOWAIT); | 6944 | ahc->critical_sections = kmalloc(cs_count, GFP_ATOMIC); |
6951 | if (ahc->critical_sections == NULL) | 6945 | if (ahc->critical_sections == NULL) |
6952 | panic("ahc_loadseq: Could not malloc"); | 6946 | panic("ahc_loadseq: Could not malloc"); |
6953 | memcpy(ahc->critical_sections, cs_table, cs_count); | 6947 | memcpy(ahc->critical_sections, cs_table, cs_count); |
@@ -6955,8 +6949,8 @@ ahc_loadseq(struct ahc_softc *ahc) | |||
6955 | ahc_outb(ahc, SEQCTL, PERRORDIS|FAILDIS|FASTMODE); | 6949 | ahc_outb(ahc, SEQCTL, PERRORDIS|FAILDIS|FASTMODE); |
6956 | 6950 | ||
6957 | if (bootverbose) { | 6951 | if (bootverbose) { |
6958 | printf(" %d instructions downloaded\n", downloaded); | 6952 | printk(" %d instructions downloaded\n", downloaded); |
6959 | printf("%s: Features 0x%x, Bugs 0x%x, Flags 0x%x\n", | 6953 | printk("%s: Features 0x%x, Bugs 0x%x, Flags 0x%x\n", |
6960 | ahc_name(ahc), ahc->features, ahc->bugs, ahc->flags); | 6954 | ahc_name(ahc), ahc->features, ahc->bugs, ahc->flags); |
6961 | } | 6955 | } |
6962 | return (0); | 6956 | return (0); |
@@ -7132,12 +7126,12 @@ ahc_print_register(const ahc_reg_parse_entry_t *table, u_int num_entries, | |||
7132 | u_int printed_mask; | 7126 | u_int printed_mask; |
7133 | 7127 | ||
7134 | if (cur_column != NULL && *cur_column >= wrap_point) { | 7128 | if (cur_column != NULL && *cur_column >= wrap_point) { |
7135 | printf("\n"); | 7129 | printk("\n"); |
7136 | *cur_column = 0; | 7130 | *cur_column = 0; |
7137 | } | 7131 | } |
7138 | printed = printf("%s[0x%x]", name, value); | 7132 | printed = printk("%s[0x%x]", name, value); |
7139 | if (table == NULL) { | 7133 | if (table == NULL) { |
7140 | printed += printf(" "); | 7134 | printed += printk(" "); |
7141 | *cur_column += printed; | 7135 | *cur_column += printed; |
7142 | return (printed); | 7136 | return (printed); |
7143 | } | 7137 | } |
@@ -7152,7 +7146,7 @@ ahc_print_register(const ahc_reg_parse_entry_t *table, u_int num_entries, | |||
7152 | == table[entry].mask)) | 7146 | == table[entry].mask)) |
7153 | continue; | 7147 | continue; |
7154 | 7148 | ||
7155 | printed += printf("%s%s", | 7149 | printed += printk("%s%s", |
7156 | printed_mask == 0 ? ":(" : "|", | 7150 | printed_mask == 0 ? ":(" : "|", |
7157 | table[entry].name); | 7151 | table[entry].name); |
7158 | printed_mask |= table[entry].mask; | 7152 | printed_mask |= table[entry].mask; |
@@ -7163,9 +7157,9 @@ ahc_print_register(const ahc_reg_parse_entry_t *table, u_int num_entries, | |||
7163 | break; | 7157 | break; |
7164 | } | 7158 | } |
7165 | if (printed_mask != 0) | 7159 | if (printed_mask != 0) |
7166 | printed += printf(") "); | 7160 | printed += printk(") "); |
7167 | else | 7161 | else |
7168 | printed += printf(" "); | 7162 | printed += printk(" "); |
7169 | if (cur_column != NULL) | 7163 | if (cur_column != NULL) |
7170 | *cur_column += printed; | 7164 | *cur_column += printed; |
7171 | return (printed); | 7165 | return (printed); |
@@ -7197,16 +7191,16 @@ ahc_dump_card_state(struct ahc_softc *ahc) | |||
7197 | 7191 | ||
7198 | saved_scbptr = ahc_inb(ahc, SCBPTR); | 7192 | saved_scbptr = ahc_inb(ahc, SCBPTR); |
7199 | last_phase = ahc_inb(ahc, LASTPHASE); | 7193 | last_phase = ahc_inb(ahc, LASTPHASE); |
7200 | printf(">>>>>>>>>>>>>>>>>> Dump Card State Begins <<<<<<<<<<<<<<<<<\n" | 7194 | printk(">>>>>>>>>>>>>>>>>> Dump Card State Begins <<<<<<<<<<<<<<<<<\n" |
7201 | "%s: Dumping Card State %s, at SEQADDR 0x%x\n", | 7195 | "%s: Dumping Card State %s, at SEQADDR 0x%x\n", |
7202 | ahc_name(ahc), ahc_lookup_phase_entry(last_phase)->phasemsg, | 7196 | ahc_name(ahc), ahc_lookup_phase_entry(last_phase)->phasemsg, |
7203 | ahc_inb(ahc, SEQADDR0) | (ahc_inb(ahc, SEQADDR1) << 8)); | 7197 | ahc_inb(ahc, SEQADDR0) | (ahc_inb(ahc, SEQADDR1) << 8)); |
7204 | if (paused) | 7198 | if (paused) |
7205 | printf("Card was paused\n"); | 7199 | printk("Card was paused\n"); |
7206 | printf("ACCUM = 0x%x, SINDEX = 0x%x, DINDEX = 0x%x, ARG_2 = 0x%x\n", | 7200 | printk("ACCUM = 0x%x, SINDEX = 0x%x, DINDEX = 0x%x, ARG_2 = 0x%x\n", |
7207 | ahc_inb(ahc, ACCUM), ahc_inb(ahc, SINDEX), ahc_inb(ahc, DINDEX), | 7201 | ahc_inb(ahc, ACCUM), ahc_inb(ahc, SINDEX), ahc_inb(ahc, DINDEX), |
7208 | ahc_inb(ahc, ARG_2)); | 7202 | ahc_inb(ahc, ARG_2)); |
7209 | printf("HCNT = 0x%x SCBPTR = 0x%x\n", ahc_inb(ahc, HCNT), | 7203 | printk("HCNT = 0x%x SCBPTR = 0x%x\n", ahc_inb(ahc, HCNT), |
7210 | ahc_inb(ahc, SCBPTR)); | 7204 | ahc_inb(ahc, SCBPTR)); |
7211 | cur_col = 0; | 7205 | cur_col = 0; |
7212 | if ((ahc->features & AHC_DT) != 0) | 7206 | if ((ahc->features & AHC_DT) != 0) |
@@ -7230,15 +7224,15 @@ ahc_dump_card_state(struct ahc_softc *ahc) | |||
7230 | ahc_dfcntrl_print(ahc_inb(ahc, DFCNTRL), &cur_col, 50); | 7224 | ahc_dfcntrl_print(ahc_inb(ahc, DFCNTRL), &cur_col, 50); |
7231 | ahc_dfstatus_print(ahc_inb(ahc, DFSTATUS), &cur_col, 50); | 7225 | ahc_dfstatus_print(ahc_inb(ahc, DFSTATUS), &cur_col, 50); |
7232 | if (cur_col != 0) | 7226 | if (cur_col != 0) |
7233 | printf("\n"); | 7227 | printk("\n"); |
7234 | printf("STACK:"); | 7228 | printk("STACK:"); |
7235 | for (i = 0; i < STACK_SIZE; i++) | 7229 | for (i = 0; i < STACK_SIZE; i++) |
7236 | printf(" 0x%x", ahc_inb(ahc, STACK)|(ahc_inb(ahc, STACK) << 8)); | 7230 | printk(" 0x%x", ahc_inb(ahc, STACK)|(ahc_inb(ahc, STACK) << 8)); |
7237 | printf("\nSCB count = %d\n", ahc->scb_data->numscbs); | 7231 | printk("\nSCB count = %d\n", ahc->scb_data->numscbs); |
7238 | printf("Kernel NEXTQSCB = %d\n", ahc->next_queued_scb->hscb->tag); | 7232 | printk("Kernel NEXTQSCB = %d\n", ahc->next_queued_scb->hscb->tag); |
7239 | printf("Card NEXTQSCB = %d\n", ahc_inb(ahc, NEXT_QUEUED_SCB)); | 7233 | printk("Card NEXTQSCB = %d\n", ahc_inb(ahc, NEXT_QUEUED_SCB)); |
7240 | /* QINFIFO */ | 7234 | /* QINFIFO */ |
7241 | printf("QINFIFO entries: "); | 7235 | printk("QINFIFO entries: "); |
7242 | if ((ahc->features & AHC_QUEUE_REGS) != 0) { | 7236 | if ((ahc->features & AHC_QUEUE_REGS) != 0) { |
7243 | qinpos = ahc_inb(ahc, SNSCB_QOFF); | 7237 | qinpos = ahc_inb(ahc, SNSCB_QOFF); |
7244 | ahc_outb(ahc, SNSCB_QOFF, qinpos); | 7238 | ahc_outb(ahc, SNSCB_QOFF, qinpos); |
@@ -7246,109 +7240,109 @@ ahc_dump_card_state(struct ahc_softc *ahc) | |||
7246 | qinpos = ahc_inb(ahc, QINPOS); | 7240 | qinpos = ahc_inb(ahc, QINPOS); |
7247 | qintail = ahc->qinfifonext; | 7241 | qintail = ahc->qinfifonext; |
7248 | while (qinpos != qintail) { | 7242 | while (qinpos != qintail) { |
7249 | printf("%d ", ahc->qinfifo[qinpos]); | 7243 | printk("%d ", ahc->qinfifo[qinpos]); |
7250 | qinpos++; | 7244 | qinpos++; |
7251 | } | 7245 | } |
7252 | printf("\n"); | 7246 | printk("\n"); |
7253 | 7247 | ||
7254 | printf("Waiting Queue entries: "); | 7248 | printk("Waiting Queue entries: "); |
7255 | scb_index = ahc_inb(ahc, WAITING_SCBH); | 7249 | scb_index = ahc_inb(ahc, WAITING_SCBH); |
7256 | i = 0; | 7250 | i = 0; |
7257 | while (scb_index != SCB_LIST_NULL && i++ < 256) { | 7251 | while (scb_index != SCB_LIST_NULL && i++ < 256) { |
7258 | ahc_outb(ahc, SCBPTR, scb_index); | 7252 | ahc_outb(ahc, SCBPTR, scb_index); |
7259 | printf("%d:%d ", scb_index, ahc_inb(ahc, SCB_TAG)); | 7253 | printk("%d:%d ", scb_index, ahc_inb(ahc, SCB_TAG)); |
7260 | scb_index = ahc_inb(ahc, SCB_NEXT); | 7254 | scb_index = ahc_inb(ahc, SCB_NEXT); |
7261 | } | 7255 | } |
7262 | printf("\n"); | 7256 | printk("\n"); |
7263 | 7257 | ||
7264 | printf("Disconnected Queue entries: "); | 7258 | printk("Disconnected Queue entries: "); |
7265 | scb_index = ahc_inb(ahc, DISCONNECTED_SCBH); | 7259 | scb_index = ahc_inb(ahc, DISCONNECTED_SCBH); |
7266 | i = 0; | 7260 | i = 0; |
7267 | while (scb_index != SCB_LIST_NULL && i++ < 256) { | 7261 | while (scb_index != SCB_LIST_NULL && i++ < 256) { |
7268 | ahc_outb(ahc, SCBPTR, scb_index); | 7262 | ahc_outb(ahc, SCBPTR, scb_index); |
7269 | printf("%d:%d ", scb_index, ahc_inb(ahc, SCB_TAG)); | 7263 | printk("%d:%d ", scb_index, ahc_inb(ahc, SCB_TAG)); |
7270 | scb_index = ahc_inb(ahc, SCB_NEXT); | 7264 | scb_index = ahc_inb(ahc, SCB_NEXT); |
7271 | } | 7265 | } |
7272 | printf("\n"); | 7266 | printk("\n"); |
7273 | 7267 | ||
7274 | ahc_sync_qoutfifo(ahc, BUS_DMASYNC_POSTREAD); | 7268 | ahc_sync_qoutfifo(ahc, BUS_DMASYNC_POSTREAD); |
7275 | printf("QOUTFIFO entries: "); | 7269 | printk("QOUTFIFO entries: "); |
7276 | qoutpos = ahc->qoutfifonext; | 7270 | qoutpos = ahc->qoutfifonext; |
7277 | i = 0; | 7271 | i = 0; |
7278 | while (ahc->qoutfifo[qoutpos] != SCB_LIST_NULL && i++ < 256) { | 7272 | while (ahc->qoutfifo[qoutpos] != SCB_LIST_NULL && i++ < 256) { |
7279 | printf("%d ", ahc->qoutfifo[qoutpos]); | 7273 | printk("%d ", ahc->qoutfifo[qoutpos]); |
7280 | qoutpos++; | 7274 | qoutpos++; |
7281 | } | 7275 | } |
7282 | printf("\n"); | 7276 | printk("\n"); |
7283 | 7277 | ||
7284 | printf("Sequencer Free SCB List: "); | 7278 | printk("Sequencer Free SCB List: "); |
7285 | scb_index = ahc_inb(ahc, FREE_SCBH); | 7279 | scb_index = ahc_inb(ahc, FREE_SCBH); |
7286 | i = 0; | 7280 | i = 0; |
7287 | while (scb_index != SCB_LIST_NULL && i++ < 256) { | 7281 | while (scb_index != SCB_LIST_NULL && i++ < 256) { |
7288 | ahc_outb(ahc, SCBPTR, scb_index); | 7282 | ahc_outb(ahc, SCBPTR, scb_index); |
7289 | printf("%d ", scb_index); | 7283 | printk("%d ", scb_index); |
7290 | scb_index = ahc_inb(ahc, SCB_NEXT); | 7284 | scb_index = ahc_inb(ahc, SCB_NEXT); |
7291 | } | 7285 | } |
7292 | printf("\n"); | 7286 | printk("\n"); |
7293 | 7287 | ||
7294 | printf("Sequencer SCB Info: "); | 7288 | printk("Sequencer SCB Info: "); |
7295 | for (i = 0; i < ahc->scb_data->maxhscbs; i++) { | 7289 | for (i = 0; i < ahc->scb_data->maxhscbs; i++) { |
7296 | ahc_outb(ahc, SCBPTR, i); | 7290 | ahc_outb(ahc, SCBPTR, i); |
7297 | cur_col = printf("\n%3d ", i); | 7291 | cur_col = printk("\n%3d ", i); |
7298 | 7292 | ||
7299 | ahc_scb_control_print(ahc_inb(ahc, SCB_CONTROL), &cur_col, 60); | 7293 | ahc_scb_control_print(ahc_inb(ahc, SCB_CONTROL), &cur_col, 60); |
7300 | ahc_scb_scsiid_print(ahc_inb(ahc, SCB_SCSIID), &cur_col, 60); | 7294 | ahc_scb_scsiid_print(ahc_inb(ahc, SCB_SCSIID), &cur_col, 60); |
7301 | ahc_scb_lun_print(ahc_inb(ahc, SCB_LUN), &cur_col, 60); | 7295 | ahc_scb_lun_print(ahc_inb(ahc, SCB_LUN), &cur_col, 60); |
7302 | ahc_scb_tag_print(ahc_inb(ahc, SCB_TAG), &cur_col, 60); | 7296 | ahc_scb_tag_print(ahc_inb(ahc, SCB_TAG), &cur_col, 60); |
7303 | } | 7297 | } |
7304 | printf("\n"); | 7298 | printk("\n"); |
7305 | 7299 | ||
7306 | printf("Pending list: "); | 7300 | printk("Pending list: "); |
7307 | i = 0; | 7301 | i = 0; |
7308 | LIST_FOREACH(scb, &ahc->pending_scbs, pending_links) { | 7302 | LIST_FOREACH(scb, &ahc->pending_scbs, pending_links) { |
7309 | if (i++ > 256) | 7303 | if (i++ > 256) |
7310 | break; | 7304 | break; |
7311 | cur_col = printf("\n%3d ", scb->hscb->tag); | 7305 | cur_col = printk("\n%3d ", scb->hscb->tag); |
7312 | ahc_scb_control_print(scb->hscb->control, &cur_col, 60); | 7306 | ahc_scb_control_print(scb->hscb->control, &cur_col, 60); |
7313 | ahc_scb_scsiid_print(scb->hscb->scsiid, &cur_col, 60); | 7307 | ahc_scb_scsiid_print(scb->hscb->scsiid, &cur_col, 60); |
7314 | ahc_scb_lun_print(scb->hscb->lun, &cur_col, 60); | 7308 | ahc_scb_lun_print(scb->hscb->lun, &cur_col, 60); |
7315 | if ((ahc->flags & AHC_PAGESCBS) == 0) { | 7309 | if ((ahc->flags & AHC_PAGESCBS) == 0) { |
7316 | ahc_outb(ahc, SCBPTR, scb->hscb->tag); | 7310 | ahc_outb(ahc, SCBPTR, scb->hscb->tag); |
7317 | printf("("); | 7311 | printk("("); |
7318 | ahc_scb_control_print(ahc_inb(ahc, SCB_CONTROL), | 7312 | ahc_scb_control_print(ahc_inb(ahc, SCB_CONTROL), |
7319 | &cur_col, 60); | 7313 | &cur_col, 60); |
7320 | ahc_scb_tag_print(ahc_inb(ahc, SCB_TAG), &cur_col, 60); | 7314 | ahc_scb_tag_print(ahc_inb(ahc, SCB_TAG), &cur_col, 60); |
7321 | printf(")"); | 7315 | printk(")"); |
7322 | } | 7316 | } |
7323 | } | 7317 | } |
7324 | printf("\n"); | 7318 | printk("\n"); |
7325 | 7319 | ||
7326 | printf("Kernel Free SCB list: "); | 7320 | printk("Kernel Free SCB list: "); |
7327 | i = 0; | 7321 | i = 0; |
7328 | SLIST_FOREACH(scb, &ahc->scb_data->free_scbs, links.sle) { | 7322 | SLIST_FOREACH(scb, &ahc->scb_data->free_scbs, links.sle) { |
7329 | if (i++ > 256) | 7323 | if (i++ > 256) |
7330 | break; | 7324 | break; |
7331 | printf("%d ", scb->hscb->tag); | 7325 | printk("%d ", scb->hscb->tag); |
7332 | } | 7326 | } |
7333 | printf("\n"); | 7327 | printk("\n"); |
7334 | 7328 | ||
7335 | maxtarget = (ahc->features & (AHC_WIDE|AHC_TWIN)) ? 15 : 7; | 7329 | maxtarget = (ahc->features & (AHC_WIDE|AHC_TWIN)) ? 15 : 7; |
7336 | for (target = 0; target <= maxtarget; target++) { | 7330 | for (target = 0; target <= maxtarget; target++) { |
7337 | untagged_q = &ahc->untagged_queues[target]; | 7331 | untagged_q = &ahc->untagged_queues[target]; |
7338 | if (TAILQ_FIRST(untagged_q) == NULL) | 7332 | if (TAILQ_FIRST(untagged_q) == NULL) |
7339 | continue; | 7333 | continue; |
7340 | printf("Untagged Q(%d): ", target); | 7334 | printk("Untagged Q(%d): ", target); |
7341 | i = 0; | 7335 | i = 0; |
7342 | TAILQ_FOREACH(scb, untagged_q, links.tqe) { | 7336 | TAILQ_FOREACH(scb, untagged_q, links.tqe) { |
7343 | if (i++ > 256) | 7337 | if (i++ > 256) |
7344 | break; | 7338 | break; |
7345 | printf("%d ", scb->hscb->tag); | 7339 | printk("%d ", scb->hscb->tag); |
7346 | } | 7340 | } |
7347 | printf("\n"); | 7341 | printk("\n"); |
7348 | } | 7342 | } |
7349 | 7343 | ||
7350 | ahc_platform_dump_card_state(ahc); | 7344 | ahc_platform_dump_card_state(ahc); |
7351 | printf("\n<<<<<<<<<<<<<<<<< Dump Card State Ends >>>>>>>>>>>>>>>>>>\n"); | 7345 | printk("\n<<<<<<<<<<<<<<<<< Dump Card State Ends >>>>>>>>>>>>>>>>>>\n"); |
7352 | ahc_outb(ahc, SCBPTR, saved_scbptr); | 7346 | ahc_outb(ahc, SCBPTR, saved_scbptr); |
7353 | if (paused == 0) | 7347 | if (paused == 0) |
7354 | ahc_unpause(ahc); | 7348 | ahc_unpause(ahc); |
@@ -7489,7 +7483,7 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb) | |||
7489 | u_long s; | 7483 | u_long s; |
7490 | ahc_flag saved_flags; | 7484 | ahc_flag saved_flags; |
7491 | 7485 | ||
7492 | printf("Configuring Target Mode\n"); | 7486 | printk("Configuring Target Mode\n"); |
7493 | ahc_lock(ahc, &s); | 7487 | ahc_lock(ahc, &s); |
7494 | if (LIST_FIRST(&ahc->pending_scbs) != NULL) { | 7488 | if (LIST_FIRST(&ahc->pending_scbs) != NULL) { |
7495 | ccb->ccb_h.status = CAM_BUSY; | 7489 | ccb->ccb_h.status = CAM_BUSY; |
@@ -7535,7 +7529,7 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb) | |||
7535 | /* Are we already enabled?? */ | 7529 | /* Are we already enabled?? */ |
7536 | if (lstate != NULL) { | 7530 | if (lstate != NULL) { |
7537 | xpt_print_path(ccb->ccb_h.path); | 7531 | xpt_print_path(ccb->ccb_h.path); |
7538 | printf("Lun already enabled\n"); | 7532 | printk("Lun already enabled\n"); |
7539 | ccb->ccb_h.status = CAM_LUN_ALRDY_ENA; | 7533 | ccb->ccb_h.status = CAM_LUN_ALRDY_ENA; |
7540 | return; | 7534 | return; |
7541 | } | 7535 | } |
@@ -7547,7 +7541,7 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb) | |||
7547 | * specific commands. | 7541 | * specific commands. |
7548 | */ | 7542 | */ |
7549 | ccb->ccb_h.status = CAM_REQ_INVALID; | 7543 | ccb->ccb_h.status = CAM_REQ_INVALID; |
7550 | printf("Non-zero Group Codes\n"); | 7544 | printk("Non-zero Group Codes\n"); |
7551 | return; | 7545 | return; |
7552 | } | 7546 | } |
7553 | 7547 | ||
@@ -7559,15 +7553,15 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb) | |||
7559 | tstate = ahc_alloc_tstate(ahc, target, channel); | 7553 | tstate = ahc_alloc_tstate(ahc, target, channel); |
7560 | if (tstate == NULL) { | 7554 | if (tstate == NULL) { |
7561 | xpt_print_path(ccb->ccb_h.path); | 7555 | xpt_print_path(ccb->ccb_h.path); |
7562 | printf("Couldn't allocate tstate\n"); | 7556 | printk("Couldn't allocate tstate\n"); |
7563 | ccb->ccb_h.status = CAM_RESRC_UNAVAIL; | 7557 | ccb->ccb_h.status = CAM_RESRC_UNAVAIL; |
7564 | return; | 7558 | return; |
7565 | } | 7559 | } |
7566 | } | 7560 | } |
7567 | lstate = malloc(sizeof(*lstate), M_DEVBUF, M_NOWAIT); | 7561 | lstate = kmalloc(sizeof(*lstate), GFP_ATOMIC); |
7568 | if (lstate == NULL) { | 7562 | if (lstate == NULL) { |
7569 | xpt_print_path(ccb->ccb_h.path); | 7563 | xpt_print_path(ccb->ccb_h.path); |
7570 | printf("Couldn't allocate lstate\n"); | 7564 | printk("Couldn't allocate lstate\n"); |
7571 | ccb->ccb_h.status = CAM_RESRC_UNAVAIL; | 7565 | ccb->ccb_h.status = CAM_RESRC_UNAVAIL; |
7572 | return; | 7566 | return; |
7573 | } | 7567 | } |
@@ -7577,9 +7571,9 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb) | |||
7577 | xpt_path_target_id(ccb->ccb_h.path), | 7571 | xpt_path_target_id(ccb->ccb_h.path), |
7578 | xpt_path_lun_id(ccb->ccb_h.path)); | 7572 | xpt_path_lun_id(ccb->ccb_h.path)); |
7579 | if (status != CAM_REQ_CMP) { | 7573 | if (status != CAM_REQ_CMP) { |
7580 | free(lstate, M_DEVBUF); | 7574 | kfree(lstate); |
7581 | xpt_print_path(ccb->ccb_h.path); | 7575 | xpt_print_path(ccb->ccb_h.path); |
7582 | printf("Couldn't allocate path\n"); | 7576 | printk("Couldn't allocate path\n"); |
7583 | ccb->ccb_h.status = CAM_RESRC_UNAVAIL; | 7577 | ccb->ccb_h.status = CAM_RESRC_UNAVAIL; |
7584 | return; | 7578 | return; |
7585 | } | 7579 | } |
@@ -7654,7 +7648,7 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb) | |||
7654 | ahc_unlock(ahc, &s); | 7648 | ahc_unlock(ahc, &s); |
7655 | ccb->ccb_h.status = CAM_REQ_CMP; | 7649 | ccb->ccb_h.status = CAM_REQ_CMP; |
7656 | xpt_print_path(ccb->ccb_h.path); | 7650 | xpt_print_path(ccb->ccb_h.path); |
7657 | printf("Lun now enabled for target mode\n"); | 7651 | printk("Lun now enabled for target mode\n"); |
7658 | } else { | 7652 | } else { |
7659 | struct scb *scb; | 7653 | struct scb *scb; |
7660 | int i, empty; | 7654 | int i, empty; |
@@ -7673,7 +7667,7 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb) | |||
7673 | ccbh = &scb->io_ctx->ccb_h; | 7667 | ccbh = &scb->io_ctx->ccb_h; |
7674 | if (ccbh->func_code == XPT_CONT_TARGET_IO | 7668 | if (ccbh->func_code == XPT_CONT_TARGET_IO |
7675 | && !xpt_path_comp(ccbh->path, ccb->ccb_h.path)){ | 7669 | && !xpt_path_comp(ccbh->path, ccb->ccb_h.path)){ |
7676 | printf("CTIO pending\n"); | 7670 | printk("CTIO pending\n"); |
7677 | ccb->ccb_h.status = CAM_REQ_INVALID; | 7671 | ccb->ccb_h.status = CAM_REQ_INVALID; |
7678 | ahc_unlock(ahc, &s); | 7672 | ahc_unlock(ahc, &s); |
7679 | return; | 7673 | return; |
@@ -7681,12 +7675,12 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb) | |||
7681 | } | 7675 | } |
7682 | 7676 | ||
7683 | if (SLIST_FIRST(&lstate->accept_tios) != NULL) { | 7677 | if (SLIST_FIRST(&lstate->accept_tios) != NULL) { |
7684 | printf("ATIOs pending\n"); | 7678 | printk("ATIOs pending\n"); |
7685 | ccb->ccb_h.status = CAM_REQ_INVALID; | 7679 | ccb->ccb_h.status = CAM_REQ_INVALID; |
7686 | } | 7680 | } |
7687 | 7681 | ||
7688 | if (SLIST_FIRST(&lstate->immed_notifies) != NULL) { | 7682 | if (SLIST_FIRST(&lstate->immed_notifies) != NULL) { |
7689 | printf("INOTs pending\n"); | 7683 | printk("INOTs pending\n"); |
7690 | ccb->ccb_h.status = CAM_REQ_INVALID; | 7684 | ccb->ccb_h.status = CAM_REQ_INVALID; |
7691 | } | 7685 | } |
7692 | 7686 | ||
@@ -7696,9 +7690,9 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb) | |||
7696 | } | 7690 | } |
7697 | 7691 | ||
7698 | xpt_print_path(ccb->ccb_h.path); | 7692 | xpt_print_path(ccb->ccb_h.path); |
7699 | printf("Target mode disabled\n"); | 7693 | printk("Target mode disabled\n"); |
7700 | xpt_free_path(lstate->path); | 7694 | xpt_free_path(lstate->path); |
7701 | free(lstate, M_DEVBUF); | 7695 | kfree(lstate); |
7702 | 7696 | ||
7703 | ahc_pause(ahc); | 7697 | ahc_pause(ahc); |
7704 | /* Can we clean up the target too? */ | 7698 | /* Can we clean up the target too? */ |
@@ -7750,7 +7744,7 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb) | |||
7750 | ahc_outb(ahc, SCSISEQ, scsiseq); | 7744 | ahc_outb(ahc, SCSISEQ, scsiseq); |
7751 | 7745 | ||
7752 | if ((ahc->features & AHC_MULTIROLE) == 0) { | 7746 | if ((ahc->features & AHC_MULTIROLE) == 0) { |
7753 | printf("Configuring Initiator Mode\n"); | 7747 | printk("Configuring Initiator Mode\n"); |
7754 | ahc->flags &= ~AHC_TARGETROLE; | 7748 | ahc->flags &= ~AHC_TARGETROLE; |
7755 | ahc->flags |= AHC_INITIATORROLE; | 7749 | ahc->flags |= AHC_INITIATORROLE; |
7756 | /* | 7750 | /* |
@@ -7897,12 +7891,12 @@ ahc_handle_target_cmd(struct ahc_softc *ahc, struct target_cmd *cmd) | |||
7897 | * Wait for more ATIOs from the peripheral driver for this lun. | 7891 | * Wait for more ATIOs from the peripheral driver for this lun. |
7898 | */ | 7892 | */ |
7899 | if (bootverbose) | 7893 | if (bootverbose) |
7900 | printf("%s: ATIOs exhausted\n", ahc_name(ahc)); | 7894 | printk("%s: ATIOs exhausted\n", ahc_name(ahc)); |
7901 | return (1); | 7895 | return (1); |
7902 | } else | 7896 | } else |
7903 | ahc->flags &= ~AHC_TQINFIFO_BLOCKED; | 7897 | ahc->flags &= ~AHC_TQINFIFO_BLOCKED; |
7904 | #if 0 | 7898 | #if 0 |
7905 | printf("Incoming command from %d for %d:%d%s\n", | 7899 | printk("Incoming command from %d for %d:%d%s\n", |
7906 | initiator, target, lun, | 7900 | initiator, target, lun, |
7907 | lstate == ahc->black_hole ? "(Black Holed)" : ""); | 7901 | lstate == ahc->black_hole ? "(Black Holed)" : ""); |
7908 | #endif | 7902 | #endif |
@@ -7949,7 +7943,7 @@ ahc_handle_target_cmd(struct ahc_softc *ahc, struct target_cmd *cmd) | |||
7949 | default: | 7943 | default: |
7950 | /* Only copy the opcode. */ | 7944 | /* Only copy the opcode. */ |
7951 | atio->cdb_len = 1; | 7945 | atio->cdb_len = 1; |
7952 | printf("Reserved or VU command code type encountered\n"); | 7946 | printk("Reserved or VU command code type encountered\n"); |
7953 | break; | 7947 | break; |
7954 | } | 7948 | } |
7955 | 7949 | ||
@@ -7965,7 +7959,7 @@ ahc_handle_target_cmd(struct ahc_softc *ahc, struct target_cmd *cmd) | |||
7965 | * to this accept tio. | 7959 | * to this accept tio. |
7966 | */ | 7960 | */ |
7967 | #if 0 | 7961 | #if 0 |
7968 | printf("Received Immediate Command %d:%d:%d - %p\n", | 7962 | printk("Received Immediate Command %d:%d:%d - %p\n", |
7969 | initiator, target, lun, ahc->pending_device); | 7963 | initiator, target, lun, ahc->pending_device); |
7970 | #endif | 7964 | #endif |
7971 | ahc->pending_device = lstate; | 7965 | ahc->pending_device = lstate; |
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index 5e42dac23505..aeea7a61478e 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c | |||
@@ -653,7 +653,7 @@ ahc_linux_slave_alloc(struct scsi_device *sdev) | |||
653 | struct ahc_linux_device *dev; | 653 | struct ahc_linux_device *dev; |
654 | 654 | ||
655 | if (bootverbose) | 655 | if (bootverbose) |
656 | printf("%s: Slave Alloc %d\n", ahc_name(ahc), sdev->id); | 656 | printk("%s: Slave Alloc %d\n", ahc_name(ahc), sdev->id); |
657 | 657 | ||
658 | dev = scsi_transport_device_data(sdev); | 658 | dev = scsi_transport_device_data(sdev); |
659 | memset(dev, 0, sizeof(*dev)); | 659 | memset(dev, 0, sizeof(*dev)); |
@@ -755,7 +755,7 @@ ahc_linux_abort(struct scsi_cmnd *cmd) | |||
755 | 755 | ||
756 | error = ahc_linux_queue_recovery_cmd(cmd, SCB_ABORT); | 756 | error = ahc_linux_queue_recovery_cmd(cmd, SCB_ABORT); |
757 | if (error != 0) | 757 | if (error != 0) |
758 | printf("aic7xxx_abort returns 0x%x\n", error); | 758 | printk("aic7xxx_abort returns 0x%x\n", error); |
759 | return (error); | 759 | return (error); |
760 | } | 760 | } |
761 | 761 | ||
@@ -769,7 +769,7 @@ ahc_linux_dev_reset(struct scsi_cmnd *cmd) | |||
769 | 769 | ||
770 | error = ahc_linux_queue_recovery_cmd(cmd, SCB_DEVICE_RESET); | 770 | error = ahc_linux_queue_recovery_cmd(cmd, SCB_DEVICE_RESET); |
771 | if (error != 0) | 771 | if (error != 0) |
772 | printf("aic7xxx_dev_reset returns 0x%x\n", error); | 772 | printk("aic7xxx_dev_reset returns 0x%x\n", error); |
773 | return (error); | 773 | return (error); |
774 | } | 774 | } |
775 | 775 | ||
@@ -791,7 +791,7 @@ ahc_linux_bus_reset(struct scsi_cmnd *cmd) | |||
791 | ahc_unlock(ahc, &flags); | 791 | ahc_unlock(ahc, &flags); |
792 | 792 | ||
793 | if (bootverbose) | 793 | if (bootverbose) |
794 | printf("%s: SCSI bus reset delivered. " | 794 | printk("%s: SCSI bus reset delivered. " |
795 | "%d SCBs aborted.\n", ahc_name(ahc), found); | 795 | "%d SCBs aborted.\n", ahc_name(ahc), found); |
796 | 796 | ||
797 | return SUCCESS; | 797 | return SUCCESS; |
@@ -840,7 +840,7 @@ ahc_dma_tag_create(struct ahc_softc *ahc, bus_dma_tag_t parent, | |||
840 | { | 840 | { |
841 | bus_dma_tag_t dmat; | 841 | bus_dma_tag_t dmat; |
842 | 842 | ||
843 | dmat = malloc(sizeof(*dmat), M_DEVBUF, M_NOWAIT); | 843 | dmat = kmalloc(sizeof(*dmat), GFP_ATOMIC); |
844 | if (dmat == NULL) | 844 | if (dmat == NULL) |
845 | return (ENOMEM); | 845 | return (ENOMEM); |
846 | 846 | ||
@@ -861,7 +861,7 @@ ahc_dma_tag_create(struct ahc_softc *ahc, bus_dma_tag_t parent, | |||
861 | void | 861 | void |
862 | ahc_dma_tag_destroy(struct ahc_softc *ahc, bus_dma_tag_t dmat) | 862 | ahc_dma_tag_destroy(struct ahc_softc *ahc, bus_dma_tag_t dmat) |
863 | { | 863 | { |
864 | free(dmat, M_DEVBUF); | 864 | kfree(dmat); |
865 | } | 865 | } |
866 | 866 | ||
867 | int | 867 | int |
@@ -918,7 +918,7 @@ ahc_linux_setup_tag_info_global(char *p) | |||
918 | int tags, i, j; | 918 | int tags, i, j; |
919 | 919 | ||
920 | tags = simple_strtoul(p + 1, NULL, 0) & 0xff; | 920 | tags = simple_strtoul(p + 1, NULL, 0) & 0xff; |
921 | printf("Setting Global Tags= %d\n", tags); | 921 | printk("Setting Global Tags= %d\n", tags); |
922 | 922 | ||
923 | for (i = 0; i < ARRAY_SIZE(aic7xxx_tag_info); i++) { | 923 | for (i = 0; i < ARRAY_SIZE(aic7xxx_tag_info); i++) { |
924 | for (j = 0; j < AHC_NUM_TARGETS; j++) { | 924 | for (j = 0; j < AHC_NUM_TARGETS; j++) { |
@@ -936,7 +936,7 @@ ahc_linux_setup_tag_info(u_long arg, int instance, int targ, int32_t value) | |||
936 | && (targ < AHC_NUM_TARGETS)) { | 936 | && (targ < AHC_NUM_TARGETS)) { |
937 | aic7xxx_tag_info[instance].tag_commands[targ] = value & 0xff; | 937 | aic7xxx_tag_info[instance].tag_commands[targ] = value & 0xff; |
938 | if (bootverbose) | 938 | if (bootverbose) |
939 | printf("tag_info[%d:%d] = %d\n", instance, targ, value); | 939 | printk("tag_info[%d:%d] = %d\n", instance, targ, value); |
940 | } | 940 | } |
941 | } | 941 | } |
942 | 942 | ||
@@ -977,7 +977,7 @@ ahc_parse_brace_option(char *opt_name, char *opt_arg, char *end, int depth, | |||
977 | if (targ == -1) | 977 | if (targ == -1) |
978 | targ = 0; | 978 | targ = 0; |
979 | } else { | 979 | } else { |
980 | printf("Malformed Option %s\n", | 980 | printk("Malformed Option %s\n", |
981 | opt_name); | 981 | opt_name); |
982 | done = TRUE; | 982 | done = TRUE; |
983 | } | 983 | } |
@@ -1120,7 +1120,7 @@ ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *templa | |||
1120 | ahc_set_unit(ahc, ahc_linux_unit++); | 1120 | ahc_set_unit(ahc, ahc_linux_unit++); |
1121 | ahc_unlock(ahc, &s); | 1121 | ahc_unlock(ahc, &s); |
1122 | sprintf(buf, "scsi%d", host->host_no); | 1122 | sprintf(buf, "scsi%d", host->host_no); |
1123 | new_name = malloc(strlen(buf) + 1, M_DEVBUF, M_NOWAIT); | 1123 | new_name = kmalloc(strlen(buf) + 1, GFP_ATOMIC); |
1124 | if (new_name != NULL) { | 1124 | if (new_name != NULL) { |
1125 | strcpy(new_name, buf); | 1125 | strcpy(new_name, buf); |
1126 | ahc_set_name(ahc, new_name); | 1126 | ahc_set_name(ahc, new_name); |
@@ -1220,7 +1220,7 @@ ahc_platform_alloc(struct ahc_softc *ahc, void *platform_arg) | |||
1220 | { | 1220 | { |
1221 | 1221 | ||
1222 | ahc->platform_data = | 1222 | ahc->platform_data = |
1223 | malloc(sizeof(struct ahc_platform_data), M_DEVBUF, M_NOWAIT); | 1223 | kmalloc(sizeof(struct ahc_platform_data), GFP_ATOMIC); |
1224 | if (ahc->platform_data == NULL) | 1224 | if (ahc->platform_data == NULL) |
1225 | return (ENOMEM); | 1225 | return (ENOMEM); |
1226 | memset(ahc->platform_data, 0, sizeof(struct ahc_platform_data)); | 1226 | memset(ahc->platform_data, 0, sizeof(struct ahc_platform_data)); |
@@ -1264,7 +1264,7 @@ ahc_platform_free(struct ahc_softc *ahc) | |||
1264 | if (ahc->platform_data->host) | 1264 | if (ahc->platform_data->host) |
1265 | scsi_host_put(ahc->platform_data->host); | 1265 | scsi_host_put(ahc->platform_data->host); |
1266 | 1266 | ||
1267 | free(ahc->platform_data, M_DEVBUF); | 1267 | kfree(ahc->platform_data); |
1268 | } | 1268 | } |
1269 | } | 1269 | } |
1270 | 1270 | ||
@@ -1378,7 +1378,7 @@ ahc_linux_user_tagdepth(struct ahc_softc *ahc, struct ahc_devinfo *devinfo) | |||
1378 | if (ahc->unit >= ARRAY_SIZE(aic7xxx_tag_info)) { | 1378 | if (ahc->unit >= ARRAY_SIZE(aic7xxx_tag_info)) { |
1379 | if (warned_user == 0) { | 1379 | if (warned_user == 0) { |
1380 | 1380 | ||
1381 | printf(KERN_WARNING | 1381 | printk(KERN_WARNING |
1382 | "aic7xxx: WARNING: Insufficient tag_info instances\n" | 1382 | "aic7xxx: WARNING: Insufficient tag_info instances\n" |
1383 | "aic7xxx: for installed controllers. Using defaults\n" | 1383 | "aic7xxx: for installed controllers. Using defaults\n" |
1384 | "aic7xxx: Please update the aic7xxx_tag_info array in\n" | 1384 | "aic7xxx: Please update the aic7xxx_tag_info array in\n" |
@@ -1421,7 +1421,7 @@ ahc_linux_device_queue_depth(struct scsi_device *sdev) | |||
1421 | ahc_send_async(ahc, devinfo.channel, devinfo.target, | 1421 | ahc_send_async(ahc, devinfo.channel, devinfo.target, |
1422 | devinfo.lun, AC_TRANSFER_NEG); | 1422 | devinfo.lun, AC_TRANSFER_NEG); |
1423 | ahc_print_devinfo(ahc, &devinfo); | 1423 | ahc_print_devinfo(ahc, &devinfo); |
1424 | printf("Tagged Queuing enabled. Depth %d\n", tags); | 1424 | printk("Tagged Queuing enabled. Depth %d\n", tags); |
1425 | } else { | 1425 | } else { |
1426 | ahc_platform_set_tags(ahc, sdev, &devinfo, AHC_QUEUE_NONE); | 1426 | ahc_platform_set_tags(ahc, sdev, &devinfo, AHC_QUEUE_NONE); |
1427 | ahc_send_async(ahc, devinfo.channel, devinfo.target, | 1427 | ahc_send_async(ahc, devinfo.channel, devinfo.target, |
@@ -1735,7 +1735,7 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb) | |||
1735 | * not have been dispatched to the controller, so | 1735 | * not have been dispatched to the controller, so |
1736 | * only check the SCB_ACTIVE flag for tagged transactions. | 1736 | * only check the SCB_ACTIVE flag for tagged transactions. |
1737 | */ | 1737 | */ |
1738 | printf("SCB %d done'd twice\n", scb->hscb->tag); | 1738 | printk("SCB %d done'd twice\n", scb->hscb->tag); |
1739 | ahc_dump_card_state(ahc); | 1739 | ahc_dump_card_state(ahc); |
1740 | panic("Stopping for safety"); | 1740 | panic("Stopping for safety"); |
1741 | } | 1741 | } |
@@ -1765,7 +1765,7 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb) | |||
1765 | #ifdef AHC_DEBUG | 1765 | #ifdef AHC_DEBUG |
1766 | if ((ahc_debug & AHC_SHOW_MISC) != 0) { | 1766 | if ((ahc_debug & AHC_SHOW_MISC) != 0) { |
1767 | ahc_print_path(ahc, scb); | 1767 | ahc_print_path(ahc, scb); |
1768 | printf("Set CAM_UNCOR_PARITY\n"); | 1768 | printk("Set CAM_UNCOR_PARITY\n"); |
1769 | } | 1769 | } |
1770 | #endif | 1770 | #endif |
1771 | ahc_set_transaction_status(scb, CAM_UNCOR_PARITY); | 1771 | ahc_set_transaction_status(scb, CAM_UNCOR_PARITY); |
@@ -1783,12 +1783,12 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb) | |||
1783 | u_int i; | 1783 | u_int i; |
1784 | 1784 | ||
1785 | ahc_print_path(ahc, scb); | 1785 | ahc_print_path(ahc, scb); |
1786 | printf("CDB:"); | 1786 | printk("CDB:"); |
1787 | for (i = 0; i < scb->io_ctx->cmd_len; i++) | 1787 | for (i = 0; i < scb->io_ctx->cmd_len; i++) |
1788 | printf(" 0x%x", scb->io_ctx->cmnd[i]); | 1788 | printk(" 0x%x", scb->io_ctx->cmnd[i]); |
1789 | printf("\n"); | 1789 | printk("\n"); |
1790 | ahc_print_path(ahc, scb); | 1790 | ahc_print_path(ahc, scb); |
1791 | printf("Saw underflow (%ld of %ld bytes). " | 1791 | printk("Saw underflow (%ld of %ld bytes). " |
1792 | "Treated as error\n", | 1792 | "Treated as error\n", |
1793 | ahc_get_residual(scb), | 1793 | ahc_get_residual(scb), |
1794 | ahc_get_transfer_length(scb)); | 1794 | ahc_get_transfer_length(scb)); |
@@ -1821,7 +1821,7 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb) | |||
1821 | dev->commands_since_idle_or_otag = 0; | 1821 | dev->commands_since_idle_or_otag = 0; |
1822 | 1822 | ||
1823 | if ((scb->flags & SCB_RECOVERY_SCB) != 0) { | 1823 | if ((scb->flags & SCB_RECOVERY_SCB) != 0) { |
1824 | printf("Recovery SCB completes\n"); | 1824 | printk("Recovery SCB completes\n"); |
1825 | if (ahc_get_transaction_status(scb) == CAM_BDR_SENT | 1825 | if (ahc_get_transaction_status(scb) == CAM_BDR_SENT |
1826 | || ahc_get_transaction_status(scb) == CAM_REQ_ABORTED) | 1826 | || ahc_get_transaction_status(scb) == CAM_REQ_ABORTED) |
1827 | ahc_set_transaction_status(scb, CAM_CMD_TIMEOUT); | 1827 | ahc_set_transaction_status(scb, CAM_CMD_TIMEOUT); |
@@ -1886,14 +1886,14 @@ ahc_linux_handle_scsi_status(struct ahc_softc *ahc, | |||
1886 | if (ahc_debug & AHC_SHOW_SENSE) { | 1886 | if (ahc_debug & AHC_SHOW_SENSE) { |
1887 | int i; | 1887 | int i; |
1888 | 1888 | ||
1889 | printf("Copied %d bytes of sense data:", | 1889 | printk("Copied %d bytes of sense data:", |
1890 | sense_size); | 1890 | sense_size); |
1891 | for (i = 0; i < sense_size; i++) { | 1891 | for (i = 0; i < sense_size; i++) { |
1892 | if ((i & 0xF) == 0) | 1892 | if ((i & 0xF) == 0) |
1893 | printf("\n"); | 1893 | printk("\n"); |
1894 | printf("0x%x ", cmd->sense_buffer[i]); | 1894 | printk("0x%x ", cmd->sense_buffer[i]); |
1895 | } | 1895 | } |
1896 | printf("\n"); | 1896 | printk("\n"); |
1897 | } | 1897 | } |
1898 | #endif | 1898 | #endif |
1899 | } | 1899 | } |
@@ -1918,7 +1918,7 @@ ahc_linux_handle_scsi_status(struct ahc_softc *ahc, | |||
1918 | dev->openings = 0; | 1918 | dev->openings = 0; |
1919 | /* | 1919 | /* |
1920 | ahc_print_path(ahc, scb); | 1920 | ahc_print_path(ahc, scb); |
1921 | printf("Dropping tag count to %d\n", dev->active); | 1921 | printk("Dropping tag count to %d\n", dev->active); |
1922 | */ | 1922 | */ |
1923 | if (dev->active == dev->tags_on_last_queuefull) { | 1923 | if (dev->active == dev->tags_on_last_queuefull) { |
1924 | 1924 | ||
@@ -1935,7 +1935,7 @@ ahc_linux_handle_scsi_status(struct ahc_softc *ahc, | |||
1935 | == AHC_LOCK_TAGS_COUNT) { | 1935 | == AHC_LOCK_TAGS_COUNT) { |
1936 | dev->maxtags = dev->active; | 1936 | dev->maxtags = dev->active; |
1937 | ahc_print_path(ahc, scb); | 1937 | ahc_print_path(ahc, scb); |
1938 | printf("Locking max tag count at %d\n", | 1938 | printk("Locking max tag count at %d\n", |
1939 | dev->active); | 1939 | dev->active); |
1940 | } | 1940 | } |
1941 | } else { | 1941 | } else { |
@@ -2100,10 +2100,10 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag) | |||
2100 | scmd_printk(KERN_INFO, cmd, "Attempting to queue a%s message\n", | 2100 | scmd_printk(KERN_INFO, cmd, "Attempting to queue a%s message\n", |
2101 | flag == SCB_ABORT ? "n ABORT" : " TARGET RESET"); | 2101 | flag == SCB_ABORT ? "n ABORT" : " TARGET RESET"); |
2102 | 2102 | ||
2103 | printf("CDB:"); | 2103 | printk("CDB:"); |
2104 | for (cdb_byte = 0; cdb_byte < cmd->cmd_len; cdb_byte++) | 2104 | for (cdb_byte = 0; cdb_byte < cmd->cmd_len; cdb_byte++) |
2105 | printf(" 0x%x", cmd->cmnd[cdb_byte]); | 2105 | printk(" 0x%x", cmd->cmnd[cdb_byte]); |
2106 | printf("\n"); | 2106 | printk("\n"); |
2107 | 2107 | ||
2108 | ahc_lock(ahc, &flags); | 2108 | ahc_lock(ahc, &flags); |
2109 | 2109 | ||
@@ -2121,7 +2121,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag) | |||
2121 | * No target device for this command exists, | 2121 | * No target device for this command exists, |
2122 | * so we must not still own the command. | 2122 | * so we must not still own the command. |
2123 | */ | 2123 | */ |
2124 | printf("%s:%d:%d:%d: Is not an active device\n", | 2124 | printk("%s:%d:%d:%d: Is not an active device\n", |
2125 | ahc_name(ahc), cmd->device->channel, cmd->device->id, | 2125 | ahc_name(ahc), cmd->device->channel, cmd->device->id, |
2126 | cmd->device->lun); | 2126 | cmd->device->lun); |
2127 | retval = SUCCESS; | 2127 | retval = SUCCESS; |
@@ -2133,7 +2133,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag) | |||
2133 | cmd->device->channel + 'A', | 2133 | cmd->device->channel + 'A', |
2134 | cmd->device->lun, | 2134 | cmd->device->lun, |
2135 | CAM_REQ_ABORTED, SEARCH_COMPLETE) != 0) { | 2135 | CAM_REQ_ABORTED, SEARCH_COMPLETE) != 0) { |
2136 | printf("%s:%d:%d:%d: Command found on untagged queue\n", | 2136 | printk("%s:%d:%d:%d: Command found on untagged queue\n", |
2137 | ahc_name(ahc), cmd->device->channel, cmd->device->id, | 2137 | ahc_name(ahc), cmd->device->channel, cmd->device->id, |
2138 | cmd->device->lun); | 2138 | cmd->device->lun); |
2139 | retval = SUCCESS; | 2139 | retval = SUCCESS; |
@@ -2187,7 +2187,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag) | |||
2187 | goto no_cmd; | 2187 | goto no_cmd; |
2188 | } | 2188 | } |
2189 | 2189 | ||
2190 | printf("%s: At time of recovery, card was %spaused\n", | 2190 | printk("%s: At time of recovery, card was %spaused\n", |
2191 | ahc_name(ahc), was_paused ? "" : "not "); | 2191 | ahc_name(ahc), was_paused ? "" : "not "); |
2192 | ahc_dump_card_state(ahc); | 2192 | ahc_dump_card_state(ahc); |
2193 | 2193 | ||
@@ -2199,7 +2199,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag) | |||
2199 | pending_scb->hscb->tag, | 2199 | pending_scb->hscb->tag, |
2200 | ROLE_INITIATOR, CAM_REQ_ABORTED, | 2200 | ROLE_INITIATOR, CAM_REQ_ABORTED, |
2201 | SEARCH_COMPLETE) > 0) { | 2201 | SEARCH_COMPLETE) > 0) { |
2202 | printf("%s:%d:%d:%d: Cmd aborted from QINFIFO\n", | 2202 | printk("%s:%d:%d:%d: Cmd aborted from QINFIFO\n", |
2203 | ahc_name(ahc), cmd->device->channel, | 2203 | ahc_name(ahc), cmd->device->channel, |
2204 | cmd->device->id, cmd->device->lun); | 2204 | cmd->device->id, cmd->device->lun); |
2205 | retval = SUCCESS; | 2205 | retval = SUCCESS; |
@@ -2313,7 +2313,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag) | |||
2313 | ahc_qinfifo_requeue_tail(ahc, pending_scb); | 2313 | ahc_qinfifo_requeue_tail(ahc, pending_scb); |
2314 | ahc_outb(ahc, SCBPTR, saved_scbptr); | 2314 | ahc_outb(ahc, SCBPTR, saved_scbptr); |
2315 | ahc_print_path(ahc, pending_scb); | 2315 | ahc_print_path(ahc, pending_scb); |
2316 | printf("Device is disconnected, re-queuing SCB\n"); | 2316 | printk("Device is disconnected, re-queuing SCB\n"); |
2317 | wait = TRUE; | 2317 | wait = TRUE; |
2318 | } else { | 2318 | } else { |
2319 | scmd_printk(KERN_INFO, cmd, "Unable to deliver message\n"); | 2319 | scmd_printk(KERN_INFO, cmd, "Unable to deliver message\n"); |
@@ -2338,16 +2338,16 @@ done: | |||
2338 | ahc->platform_data->eh_done = &done; | 2338 | ahc->platform_data->eh_done = &done; |
2339 | ahc_unlock(ahc, &flags); | 2339 | ahc_unlock(ahc, &flags); |
2340 | 2340 | ||
2341 | printf("Recovery code sleeping\n"); | 2341 | printk("Recovery code sleeping\n"); |
2342 | if (!wait_for_completion_timeout(&done, 5 * HZ)) { | 2342 | if (!wait_for_completion_timeout(&done, 5 * HZ)) { |
2343 | ahc_lock(ahc, &flags); | 2343 | ahc_lock(ahc, &flags); |
2344 | ahc->platform_data->eh_done = NULL; | 2344 | ahc->platform_data->eh_done = NULL; |
2345 | ahc_unlock(ahc, &flags); | 2345 | ahc_unlock(ahc, &flags); |
2346 | 2346 | ||
2347 | printf("Timer Expired\n"); | 2347 | printk("Timer Expired\n"); |
2348 | retval = FAILED; | 2348 | retval = FAILED; |
2349 | } | 2349 | } |
2350 | printf("Recovery code awake\n"); | 2350 | printk("Recovery code awake\n"); |
2351 | } else | 2351 | } else |
2352 | ahc_unlock(ahc, &flags); | 2352 | ahc_unlock(ahc, &flags); |
2353 | return (retval); | 2353 | return (retval); |
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.h b/drivers/scsi/aic7xxx/aic7xxx_osm.h index 56f07e527b48..bca0fb83f553 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.h +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.h | |||
@@ -368,13 +368,6 @@ struct ahc_platform_data { | |||
368 | resource_size_t mem_busaddr; /* Mem Base Addr */ | 368 | resource_size_t mem_busaddr; /* Mem Base Addr */ |
369 | }; | 369 | }; |
370 | 370 | ||
371 | /************************** OS Utility Wrappers *******************************/ | ||
372 | #define printf printk | ||
373 | #define M_NOWAIT GFP_ATOMIC | ||
374 | #define M_WAITOK 0 | ||
375 | #define malloc(size, type, flags) kmalloc(size, flags) | ||
376 | #define free(ptr, type) kfree(ptr) | ||
377 | |||
378 | void ahc_delay(long); | 371 | void ahc_delay(long); |
379 | 372 | ||
380 | 373 | ||
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c index 78fc70c24e07..ee05e8410754 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c | |||
@@ -225,7 +225,7 @@ ahc_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
225 | ahc_get_pci_bus(pci), | 225 | ahc_get_pci_bus(pci), |
226 | ahc_get_pci_slot(pci), | 226 | ahc_get_pci_slot(pci), |
227 | ahc_get_pci_function(pci)); | 227 | ahc_get_pci_function(pci)); |
228 | name = malloc(strlen(buf) + 1, M_DEVBUF, M_NOWAIT); | 228 | name = kmalloc(strlen(buf) + 1, GFP_ATOMIC); |
229 | if (name == NULL) | 229 | if (name == NULL) |
230 | return (-ENOMEM); | 230 | return (-ENOMEM); |
231 | strcpy(name, buf); | 231 | strcpy(name, buf); |
@@ -412,7 +412,7 @@ ahc_pci_map_registers(struct ahc_softc *ahc) | |||
412 | */ | 412 | */ |
413 | if (ahc_pci_test_register_access(ahc) != 0) { | 413 | if (ahc_pci_test_register_access(ahc) != 0) { |
414 | 414 | ||
415 | printf("aic7xxx: PCI Device %d:%d:%d " | 415 | printk("aic7xxx: PCI Device %d:%d:%d " |
416 | "failed memory mapped test. Using PIO.\n", | 416 | "failed memory mapped test. Using PIO.\n", |
417 | ahc_get_pci_bus(ahc->dev_softc), | 417 | ahc_get_pci_bus(ahc->dev_softc), |
418 | ahc_get_pci_slot(ahc->dev_softc), | 418 | ahc_get_pci_slot(ahc->dev_softc), |
@@ -425,7 +425,7 @@ ahc_pci_map_registers(struct ahc_softc *ahc) | |||
425 | } else | 425 | } else |
426 | command |= PCIM_CMD_MEMEN; | 426 | command |= PCIM_CMD_MEMEN; |
427 | } else { | 427 | } else { |
428 | printf("aic7xxx: PCI%d:%d:%d MEM region 0x%llx " | 428 | printk("aic7xxx: PCI%d:%d:%d MEM region 0x%llx " |
429 | "unavailable. Cannot memory map device.\n", | 429 | "unavailable. Cannot memory map device.\n", |
430 | ahc_get_pci_bus(ahc->dev_softc), | 430 | ahc_get_pci_bus(ahc->dev_softc), |
431 | ahc_get_pci_slot(ahc->dev_softc), | 431 | ahc_get_pci_slot(ahc->dev_softc), |
@@ -444,7 +444,7 @@ ahc_pci_map_registers(struct ahc_softc *ahc) | |||
444 | ahc->bsh.ioport = (u_long)base; | 444 | ahc->bsh.ioport = (u_long)base; |
445 | command |= PCIM_CMD_PORTEN; | 445 | command |= PCIM_CMD_PORTEN; |
446 | } else { | 446 | } else { |
447 | printf("aic7xxx: PCI%d:%d:%d IO region 0x%llx[0..255] " | 447 | printk("aic7xxx: PCI%d:%d:%d IO region 0x%llx[0..255] " |
448 | "unavailable. Cannot map device.\n", | 448 | "unavailable. Cannot map device.\n", |
449 | ahc_get_pci_bus(ahc->dev_softc), | 449 | ahc_get_pci_bus(ahc->dev_softc), |
450 | ahc_get_pci_slot(ahc->dev_softc), | 450 | ahc_get_pci_slot(ahc->dev_softc), |
diff --git a/drivers/scsi/aic7xxx/aic7xxx_pci.c b/drivers/scsi/aic7xxx/aic7xxx_pci.c index 27014b9de126..2b11a4272364 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_pci.c +++ b/drivers/scsi/aic7xxx/aic7xxx_pci.c | |||
@@ -752,7 +752,7 @@ ahc_pci_config(struct ahc_softc *ahc, const struct ahc_pci_identity *entry) | |||
752 | if ((ahc->flags & AHC_39BIT_ADDRESSING) != 0) { | 752 | if ((ahc->flags & AHC_39BIT_ADDRESSING) != 0) { |
753 | 753 | ||
754 | if (bootverbose) | 754 | if (bootverbose) |
755 | printf("%s: Enabling 39Bit Addressing\n", | 755 | printk("%s: Enabling 39Bit Addressing\n", |
756 | ahc_name(ahc)); | 756 | ahc_name(ahc)); |
757 | devconfig |= DACEN; | 757 | devconfig |= DACEN; |
758 | } | 758 | } |
@@ -896,7 +896,7 @@ ahc_pci_config(struct ahc_softc *ahc, const struct ahc_pci_identity *entry) | |||
896 | /* See if someone else set us up already */ | 896 | /* See if someone else set us up already */ |
897 | if ((ahc->flags & AHC_NO_BIOS_INIT) == 0 | 897 | if ((ahc->flags & AHC_NO_BIOS_INIT) == 0 |
898 | && scsiseq != 0) { | 898 | && scsiseq != 0) { |
899 | printf("%s: Using left over BIOS settings\n", | 899 | printk("%s: Using left over BIOS settings\n", |
900 | ahc_name(ahc)); | 900 | ahc_name(ahc)); |
901 | ahc->flags &= ~AHC_USEDEFAULTS; | 901 | ahc->flags &= ~AHC_USEDEFAULTS; |
902 | ahc->flags |= AHC_BIOS_ENABLED; | 902 | ahc->flags |= AHC_BIOS_ENABLED; |
@@ -1155,7 +1155,7 @@ done: | |||
1155 | ahc_outb(ahc, CLRINT, CLRPARERR); | 1155 | ahc_outb(ahc, CLRINT, CLRPARERR); |
1156 | ahc_outb(ahc, CLRINT, CLRBRKADRINT); | 1156 | ahc_outb(ahc, CLRINT, CLRBRKADRINT); |
1157 | if (bootverbose && enable) { | 1157 | if (bootverbose && enable) { |
1158 | printf("%s: External SRAM, %s access%s, %dbytes/SCB\n", | 1158 | printk("%s: External SRAM, %s access%s, %dbytes/SCB\n", |
1159 | ahc_name(ahc), fast ? "fast" : "slow", | 1159 | ahc_name(ahc), fast ? "fast" : "slow", |
1160 | pcheck ? ", parity checking enabled" : "", | 1160 | pcheck ? ", parity checking enabled" : "", |
1161 | large ? 64 : 32); | 1161 | large ? 64 : 32); |
@@ -1292,7 +1292,7 @@ check_extport(struct ahc_softc *ahc, u_int *sxfrctl1) | |||
1292 | if (have_seeprom) { | 1292 | if (have_seeprom) { |
1293 | 1293 | ||
1294 | if (bootverbose) | 1294 | if (bootverbose) |
1295 | printf("%s: Reading SEEPROM...", ahc_name(ahc)); | 1295 | printk("%s: Reading SEEPROM...", ahc_name(ahc)); |
1296 | 1296 | ||
1297 | for (;;) { | 1297 | for (;;) { |
1298 | u_int start_addr; | 1298 | u_int start_addr; |
@@ -1309,9 +1309,9 @@ check_extport(struct ahc_softc *ahc, u_int *sxfrctl1) | |||
1309 | if (have_seeprom != 0 || sd.sd_chip == C56_66) { | 1309 | if (have_seeprom != 0 || sd.sd_chip == C56_66) { |
1310 | if (bootverbose) { | 1310 | if (bootverbose) { |
1311 | if (have_seeprom == 0) | 1311 | if (have_seeprom == 0) |
1312 | printf ("checksum error\n"); | 1312 | printk ("checksum error\n"); |
1313 | else | 1313 | else |
1314 | printf ("done.\n"); | 1314 | printk ("done.\n"); |
1315 | } | 1315 | } |
1316 | break; | 1316 | break; |
1317 | } | 1317 | } |
@@ -1362,9 +1362,9 @@ check_extport(struct ahc_softc *ahc, u_int *sxfrctl1) | |||
1362 | 1362 | ||
1363 | if (!have_seeprom) { | 1363 | if (!have_seeprom) { |
1364 | if (bootverbose) | 1364 | if (bootverbose) |
1365 | printf("%s: No SEEPROM available.\n", ahc_name(ahc)); | 1365 | printk("%s: No SEEPROM available.\n", ahc_name(ahc)); |
1366 | ahc->flags |= AHC_USEDEFAULTS; | 1366 | ahc->flags |= AHC_USEDEFAULTS; |
1367 | free(ahc->seep_config, M_DEVBUF); | 1367 | kfree(ahc->seep_config); |
1368 | ahc->seep_config = NULL; | 1368 | ahc->seep_config = NULL; |
1369 | sc = NULL; | 1369 | sc = NULL; |
1370 | } else { | 1370 | } else { |
@@ -1399,7 +1399,7 @@ check_extport(struct ahc_softc *ahc, u_int *sxfrctl1) | |||
1399 | if ((sc->adapter_control & CFSTERM) != 0) | 1399 | if ((sc->adapter_control & CFSTERM) != 0) |
1400 | *sxfrctl1 |= STPWEN; | 1400 | *sxfrctl1 |= STPWEN; |
1401 | if (bootverbose) | 1401 | if (bootverbose) |
1402 | printf("%s: Low byte termination %sabled\n", | 1402 | printk("%s: Low byte termination %sabled\n", |
1403 | ahc_name(ahc), | 1403 | ahc_name(ahc), |
1404 | (*sxfrctl1 & STPWEN) ? "en" : "dis"); | 1404 | (*sxfrctl1 & STPWEN) ? "en" : "dis"); |
1405 | } | 1405 | } |
@@ -1569,7 +1569,7 @@ configure_termination(struct ahc_softc *ahc, | |||
1569 | &eeprom_present); | 1569 | &eeprom_present); |
1570 | if ((adapter_control & CFSEAUTOTERM) == 0) { | 1570 | if ((adapter_control & CFSEAUTOTERM) == 0) { |
1571 | if (bootverbose) | 1571 | if (bootverbose) |
1572 | printf("%s: Manual SE Termination\n", | 1572 | printk("%s: Manual SE Termination\n", |
1573 | ahc_name(ahc)); | 1573 | ahc_name(ahc)); |
1574 | enableSEC_low = (adapter_control & CFSELOWTERM); | 1574 | enableSEC_low = (adapter_control & CFSELOWTERM); |
1575 | enableSEC_high = | 1575 | enableSEC_high = |
@@ -1577,7 +1577,7 @@ configure_termination(struct ahc_softc *ahc, | |||
1577 | } | 1577 | } |
1578 | if ((adapter_control & CFAUTOTERM) == 0) { | 1578 | if ((adapter_control & CFAUTOTERM) == 0) { |
1579 | if (bootverbose) | 1579 | if (bootverbose) |
1580 | printf("%s: Manual LVD Termination\n", | 1580 | printk("%s: Manual LVD Termination\n", |
1581 | ahc_name(ahc)); | 1581 | ahc_name(ahc)); |
1582 | enablePRI_low = (adapter_control & CFSTERM); | 1582 | enablePRI_low = (adapter_control & CFSTERM); |
1583 | enablePRI_high = (adapter_control & CFWSTERM); | 1583 | enablePRI_high = (adapter_control & CFWSTERM); |
@@ -1604,19 +1604,19 @@ configure_termination(struct ahc_softc *ahc, | |||
1604 | 1604 | ||
1605 | if (bootverbose | 1605 | if (bootverbose |
1606 | && (ahc->features & AHC_ULTRA2) == 0) { | 1606 | && (ahc->features & AHC_ULTRA2) == 0) { |
1607 | printf("%s: internal 50 cable %s present", | 1607 | printk("%s: internal 50 cable %s present", |
1608 | ahc_name(ahc), | 1608 | ahc_name(ahc), |
1609 | internal50_present ? "is":"not"); | 1609 | internal50_present ? "is":"not"); |
1610 | 1610 | ||
1611 | if ((ahc->features & AHC_WIDE) != 0) | 1611 | if ((ahc->features & AHC_WIDE) != 0) |
1612 | printf(", internal 68 cable %s present", | 1612 | printk(", internal 68 cable %s present", |
1613 | internal68_present ? "is":"not"); | 1613 | internal68_present ? "is":"not"); |
1614 | printf("\n%s: external cable %s present\n", | 1614 | printk("\n%s: external cable %s present\n", |
1615 | ahc_name(ahc), | 1615 | ahc_name(ahc), |
1616 | externalcable_present ? "is":"not"); | 1616 | externalcable_present ? "is":"not"); |
1617 | } | 1617 | } |
1618 | if (bootverbose) | 1618 | if (bootverbose) |
1619 | printf("%s: BIOS eeprom %s present\n", | 1619 | printk("%s: BIOS eeprom %s present\n", |
1620 | ahc_name(ahc), eeprom_present ? "is" : "not"); | 1620 | ahc_name(ahc), eeprom_present ? "is" : "not"); |
1621 | 1621 | ||
1622 | if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0) { | 1622 | if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0) { |
@@ -1642,7 +1642,7 @@ configure_termination(struct ahc_softc *ahc, | |||
1642 | && (internal50_present != 0) | 1642 | && (internal50_present != 0) |
1643 | && (internal68_present != 0) | 1643 | && (internal68_present != 0) |
1644 | && (externalcable_present != 0)) { | 1644 | && (externalcable_present != 0)) { |
1645 | printf("%s: Illegal cable configuration!!. " | 1645 | printk("%s: Illegal cable configuration!!. " |
1646 | "Only two connectors on the " | 1646 | "Only two connectors on the " |
1647 | "adapter may be used at a " | 1647 | "adapter may be used at a " |
1648 | "time!\n", ahc_name(ahc)); | 1648 | "time!\n", ahc_name(ahc)); |
@@ -1664,10 +1664,10 @@ configure_termination(struct ahc_softc *ahc, | |||
1664 | brddat |= BRDDAT6; | 1664 | brddat |= BRDDAT6; |
1665 | if (bootverbose) { | 1665 | if (bootverbose) { |
1666 | if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0) | 1666 | if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0) |
1667 | printf("%s: 68 pin termination " | 1667 | printk("%s: 68 pin termination " |
1668 | "Enabled\n", ahc_name(ahc)); | 1668 | "Enabled\n", ahc_name(ahc)); |
1669 | else | 1669 | else |
1670 | printf("%s: %sHigh byte termination " | 1670 | printk("%s: %sHigh byte termination " |
1671 | "Enabled\n", ahc_name(ahc), | 1671 | "Enabled\n", ahc_name(ahc), |
1672 | enableSEC_high ? "Secondary " | 1672 | enableSEC_high ? "Secondary " |
1673 | : ""); | 1673 | : ""); |
@@ -1683,10 +1683,10 @@ configure_termination(struct ahc_softc *ahc, | |||
1683 | *sxfrctl1 |= STPWEN; | 1683 | *sxfrctl1 |= STPWEN; |
1684 | if (bootverbose) { | 1684 | if (bootverbose) { |
1685 | if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0) | 1685 | if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0) |
1686 | printf("%s: 50 pin termination " | 1686 | printk("%s: 50 pin termination " |
1687 | "Enabled\n", ahc_name(ahc)); | 1687 | "Enabled\n", ahc_name(ahc)); |
1688 | else | 1688 | else |
1689 | printf("%s: %sLow byte termination " | 1689 | printk("%s: %sLow byte termination " |
1690 | "Enabled\n", ahc_name(ahc), | 1690 | "Enabled\n", ahc_name(ahc), |
1691 | enableSEC_low ? "Secondary " | 1691 | enableSEC_low ? "Secondary " |
1692 | : ""); | 1692 | : ""); |
@@ -1696,7 +1696,7 @@ configure_termination(struct ahc_softc *ahc, | |||
1696 | if (enablePRI_low != 0) { | 1696 | if (enablePRI_low != 0) { |
1697 | *sxfrctl1 |= STPWEN; | 1697 | *sxfrctl1 |= STPWEN; |
1698 | if (bootverbose) | 1698 | if (bootverbose) |
1699 | printf("%s: Primary Low Byte termination " | 1699 | printk("%s: Primary Low Byte termination " |
1700 | "Enabled\n", ahc_name(ahc)); | 1700 | "Enabled\n", ahc_name(ahc)); |
1701 | } | 1701 | } |
1702 | 1702 | ||
@@ -1709,7 +1709,7 @@ configure_termination(struct ahc_softc *ahc, | |||
1709 | if (enablePRI_high != 0) { | 1709 | if (enablePRI_high != 0) { |
1710 | brddat |= BRDDAT4; | 1710 | brddat |= BRDDAT4; |
1711 | if (bootverbose) | 1711 | if (bootverbose) |
1712 | printf("%s: Primary High Byte " | 1712 | printk("%s: Primary High Byte " |
1713 | "termination Enabled\n", | 1713 | "termination Enabled\n", |
1714 | ahc_name(ahc)); | 1714 | ahc_name(ahc)); |
1715 | } | 1715 | } |
@@ -1721,7 +1721,7 @@ configure_termination(struct ahc_softc *ahc, | |||
1721 | *sxfrctl1 |= STPWEN; | 1721 | *sxfrctl1 |= STPWEN; |
1722 | 1722 | ||
1723 | if (bootverbose) | 1723 | if (bootverbose) |
1724 | printf("%s: %sLow byte termination Enabled\n", | 1724 | printk("%s: %sLow byte termination Enabled\n", |
1725 | ahc_name(ahc), | 1725 | ahc_name(ahc), |
1726 | (ahc->features & AHC_ULTRA2) ? "Primary " | 1726 | (ahc->features & AHC_ULTRA2) ? "Primary " |
1727 | : ""); | 1727 | : ""); |
@@ -1731,7 +1731,7 @@ configure_termination(struct ahc_softc *ahc, | |||
1731 | && (ahc->features & AHC_WIDE) != 0) { | 1731 | && (ahc->features & AHC_WIDE) != 0) { |
1732 | brddat |= BRDDAT6; | 1732 | brddat |= BRDDAT6; |
1733 | if (bootverbose) | 1733 | if (bootverbose) |
1734 | printf("%s: %sHigh byte termination Enabled\n", | 1734 | printk("%s: %sHigh byte termination Enabled\n", |
1735 | ahc_name(ahc), | 1735 | ahc_name(ahc), |
1736 | (ahc->features & AHC_ULTRA2) | 1736 | (ahc->features & AHC_ULTRA2) |
1737 | ? "Secondary " : ""); | 1737 | ? "Secondary " : ""); |
@@ -1937,29 +1937,29 @@ ahc_pci_intr(struct ahc_softc *ahc) | |||
1937 | status1 = ahc_pci_read_config(ahc->dev_softc, | 1937 | status1 = ahc_pci_read_config(ahc->dev_softc, |
1938 | PCIR_STATUS + 1, /*bytes*/1); | 1938 | PCIR_STATUS + 1, /*bytes*/1); |
1939 | 1939 | ||
1940 | printf("%s: PCI error Interrupt at seqaddr = 0x%x\n", | 1940 | printk("%s: PCI error Interrupt at seqaddr = 0x%x\n", |
1941 | ahc_name(ahc), | 1941 | ahc_name(ahc), |
1942 | ahc_inb(ahc, SEQADDR0) | (ahc_inb(ahc, SEQADDR1) << 8)); | 1942 | ahc_inb(ahc, SEQADDR0) | (ahc_inb(ahc, SEQADDR1) << 8)); |
1943 | 1943 | ||
1944 | if (status1 & DPE) { | 1944 | if (status1 & DPE) { |
1945 | ahc->pci_target_perr_count++; | 1945 | ahc->pci_target_perr_count++; |
1946 | printf("%s: Data Parity Error Detected during address " | 1946 | printk("%s: Data Parity Error Detected during address " |
1947 | "or write data phase\n", ahc_name(ahc)); | 1947 | "or write data phase\n", ahc_name(ahc)); |
1948 | } | 1948 | } |
1949 | if (status1 & SSE) { | 1949 | if (status1 & SSE) { |
1950 | printf("%s: Signal System Error Detected\n", ahc_name(ahc)); | 1950 | printk("%s: Signal System Error Detected\n", ahc_name(ahc)); |
1951 | } | 1951 | } |
1952 | if (status1 & RMA) { | 1952 | if (status1 & RMA) { |
1953 | printf("%s: Received a Master Abort\n", ahc_name(ahc)); | 1953 | printk("%s: Received a Master Abort\n", ahc_name(ahc)); |
1954 | } | 1954 | } |
1955 | if (status1 & RTA) { | 1955 | if (status1 & RTA) { |
1956 | printf("%s: Received a Target Abort\n", ahc_name(ahc)); | 1956 | printk("%s: Received a Target Abort\n", ahc_name(ahc)); |
1957 | } | 1957 | } |
1958 | if (status1 & STA) { | 1958 | if (status1 & STA) { |
1959 | printf("%s: Signaled a Target Abort\n", ahc_name(ahc)); | 1959 | printk("%s: Signaled a Target Abort\n", ahc_name(ahc)); |
1960 | } | 1960 | } |
1961 | if (status1 & DPR) { | 1961 | if (status1 & DPR) { |
1962 | printf("%s: Data Parity Error has been reported via PERR#\n", | 1962 | printk("%s: Data Parity Error has been reported via PERR#\n", |
1963 | ahc_name(ahc)); | 1963 | ahc_name(ahc)); |
1964 | } | 1964 | } |
1965 | 1965 | ||
@@ -1968,14 +1968,14 @@ ahc_pci_intr(struct ahc_softc *ahc) | |||
1968 | status1, /*bytes*/1); | 1968 | status1, /*bytes*/1); |
1969 | 1969 | ||
1970 | if ((status1 & (DPE|SSE|RMA|RTA|STA|DPR)) == 0) { | 1970 | if ((status1 & (DPE|SSE|RMA|RTA|STA|DPR)) == 0) { |
1971 | printf("%s: Latched PCIERR interrupt with " | 1971 | printk("%s: Latched PCIERR interrupt with " |
1972 | "no status bits set\n", ahc_name(ahc)); | 1972 | "no status bits set\n", ahc_name(ahc)); |
1973 | } else { | 1973 | } else { |
1974 | ahc_outb(ahc, CLRINT, CLRPARERR); | 1974 | ahc_outb(ahc, CLRINT, CLRPARERR); |
1975 | } | 1975 | } |
1976 | 1976 | ||
1977 | if (ahc->pci_target_perr_count > AHC_PCI_TARGET_PERR_THRESH) { | 1977 | if (ahc->pci_target_perr_count > AHC_PCI_TARGET_PERR_THRESH) { |
1978 | printf( | 1978 | printk( |
1979 | "%s: WARNING WARNING WARNING WARNING\n" | 1979 | "%s: WARNING WARNING WARNING WARNING\n" |
1980 | "%s: Too many PCI parity errors observed as a target.\n" | 1980 | "%s: Too many PCI parity errors observed as a target.\n" |
1981 | "%s: Some device on this bus is generating bad parity.\n" | 1981 | "%s: Some device on this bus is generating bad parity.\n" |
@@ -2386,7 +2386,7 @@ ahc_aha29160C_setup(struct ahc_softc *ahc) | |||
2386 | static int | 2386 | static int |
2387 | ahc_raid_setup(struct ahc_softc *ahc) | 2387 | ahc_raid_setup(struct ahc_softc *ahc) |
2388 | { | 2388 | { |
2389 | printf("RAID functionality unsupported\n"); | 2389 | printk("RAID functionality unsupported\n"); |
2390 | return (ENXIO); | 2390 | return (ENXIO); |
2391 | } | 2391 | } |
2392 | 2392 | ||
@@ -2404,7 +2404,7 @@ ahc_aha394XX_setup(struct ahc_softc *ahc) | |||
2404 | ahc->channel = 'B'; | 2404 | ahc->channel = 'B'; |
2405 | break; | 2405 | break; |
2406 | default: | 2406 | default: |
2407 | printf("adapter at unexpected slot %d\n" | 2407 | printk("adapter at unexpected slot %d\n" |
2408 | "unable to map to a channel\n", | 2408 | "unable to map to a channel\n", |
2409 | ahc_get_pci_slot(pci)); | 2409 | ahc_get_pci_slot(pci)); |
2410 | ahc->channel = 'A'; | 2410 | ahc->channel = 'A'; |
@@ -2429,7 +2429,7 @@ ahc_aha398XX_setup(struct ahc_softc *ahc) | |||
2429 | ahc->channel = 'C'; | 2429 | ahc->channel = 'C'; |
2430 | break; | 2430 | break; |
2431 | default: | 2431 | default: |
2432 | printf("adapter at unexpected slot %d\n" | 2432 | printk("adapter at unexpected slot %d\n" |
2433 | "unable to map to a channel\n", | 2433 | "unable to map to a channel\n", |
2434 | ahc_get_pci_slot(pci)); | 2434 | ahc_get_pci_slot(pci)); |
2435 | ahc->channel = 'A'; | 2435 | ahc->channel = 'A'; |
@@ -2459,7 +2459,7 @@ ahc_aha494XX_setup(struct ahc_softc *ahc) | |||
2459 | ahc->channel = 'D'; | 2459 | ahc->channel = 'D'; |
2460 | break; | 2460 | break; |
2461 | default: | 2461 | default: |
2462 | printf("adapter at unexpected slot %d\n" | 2462 | printk("adapter at unexpected slot %d\n" |
2463 | "unable to map to a channel\n", | 2463 | "unable to map to a channel\n", |
2464 | ahc_get_pci_slot(pci)); | 2464 | ahc_get_pci_slot(pci)); |
2465 | ahc->channel = 'A'; | 2465 | ahc->channel = 'A'; |
diff --git a/drivers/scsi/aic7xxx/aic7xxx_proc.c b/drivers/scsi/aic7xxx/aic7xxx_proc.c index e92991a7c485..f2525f8ed1c7 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_proc.c +++ b/drivers/scsi/aic7xxx/aic7xxx_proc.c | |||
@@ -248,13 +248,13 @@ ahc_proc_write_seeprom(struct ahc_softc *ahc, char *buffer, int length) | |||
248 | ahc_pause(ahc); | 248 | ahc_pause(ahc); |
249 | 249 | ||
250 | if (length != sizeof(struct seeprom_config)) { | 250 | if (length != sizeof(struct seeprom_config)) { |
251 | printf("ahc_proc_write_seeprom: incorrect buffer size\n"); | 251 | printk("ahc_proc_write_seeprom: incorrect buffer size\n"); |
252 | goto done; | 252 | goto done; |
253 | } | 253 | } |
254 | 254 | ||
255 | have_seeprom = ahc_verify_cksum((struct seeprom_config*)buffer); | 255 | have_seeprom = ahc_verify_cksum((struct seeprom_config*)buffer); |
256 | if (have_seeprom == 0) { | 256 | if (have_seeprom == 0) { |
257 | printf("ahc_proc_write_seeprom: cksum verification failed\n"); | 257 | printk("ahc_proc_write_seeprom: cksum verification failed\n"); |
258 | goto done; | 258 | goto done; |
259 | } | 259 | } |
260 | 260 | ||
@@ -290,26 +290,25 @@ ahc_proc_write_seeprom(struct ahc_softc *ahc, char *buffer, int length) | |||
290 | sd.sd_DI = DI_2840; | 290 | sd.sd_DI = DI_2840; |
291 | have_seeprom = TRUE; | 291 | have_seeprom = TRUE; |
292 | } else { | 292 | } else { |
293 | printf("ahc_proc_write_seeprom: unsupported adapter type\n"); | 293 | printk("ahc_proc_write_seeprom: unsupported adapter type\n"); |
294 | goto done; | 294 | goto done; |
295 | } | 295 | } |
296 | 296 | ||
297 | if (!have_seeprom) { | 297 | if (!have_seeprom) { |
298 | printf("ahc_proc_write_seeprom: No Serial EEPROM\n"); | 298 | printk("ahc_proc_write_seeprom: No Serial EEPROM\n"); |
299 | goto done; | 299 | goto done; |
300 | } else { | 300 | } else { |
301 | u_int start_addr; | 301 | u_int start_addr; |
302 | 302 | ||
303 | if (ahc->seep_config == NULL) { | 303 | if (ahc->seep_config == NULL) { |
304 | ahc->seep_config = malloc(sizeof(*ahc->seep_config), | 304 | ahc->seep_config = kmalloc(sizeof(*ahc->seep_config), GFP_ATOMIC); |
305 | M_DEVBUF, M_NOWAIT); | ||
306 | if (ahc->seep_config == NULL) { | 305 | if (ahc->seep_config == NULL) { |
307 | printf("aic7xxx: Unable to allocate serial " | 306 | printk("aic7xxx: Unable to allocate serial " |
308 | "eeprom buffer. Write failing\n"); | 307 | "eeprom buffer. Write failing\n"); |
309 | goto done; | 308 | goto done; |
310 | } | 309 | } |
311 | } | 310 | } |
312 | printf("aic7xxx: Writing Serial EEPROM\n"); | 311 | printk("aic7xxx: Writing Serial EEPROM\n"); |
313 | start_addr = 32 * (ahc->channel - 'A'); | 312 | start_addr = 32 * (ahc->channel - 'A'); |
314 | ahc_write_seeprom(&sd, (u_int16_t *)buffer, start_addr, | 313 | ahc_write_seeprom(&sd, (u_int16_t *)buffer, start_addr, |
315 | sizeof(struct seeprom_config)/2); | 314 | sizeof(struct seeprom_config)/2); |