Commit 48813cf9 authored by Pekka Enberg's avatar Pekka Enberg Committed by James Bottomley

[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: default avatarPekka Enberg <penberg@cs.helsinki.fi>
Acked-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 660bdddb
...@@ -170,7 +170,7 @@ aic7770_config(struct ahc_softc *ahc, struct aic7770_identity *entry, u_int io) ...@@ -170,7 +170,7 @@ aic7770_config(struct ahc_softc *ahc, struct aic7770_identity *entry, u_int io)
case 15: case 15:
break; break;
default: default:
printf("aic7770_config: invalid irq setting %d\n", intdef); printk("aic7770_config: invalid irq setting %d\n", intdef);
return (ENXIO); return (ENXIO);
} }
...@@ -221,7 +221,7 @@ aic7770_config(struct ahc_softc *ahc, struct aic7770_identity *entry, u_int io) ...@@ -221,7 +221,7 @@ aic7770_config(struct ahc_softc *ahc, struct aic7770_identity *entry, u_int io)
break; break;
} }
if (have_seeprom == 0) { if (have_seeprom == 0) {
free(ahc->seep_config, M_DEVBUF); kfree(ahc->seep_config);
ahc->seep_config = NULL; ahc->seep_config = NULL;
} }
...@@ -293,7 +293,7 @@ aha2840_load_seeprom(struct ahc_softc *ahc) ...@@ -293,7 +293,7 @@ aha2840_load_seeprom(struct ahc_softc *ahc)
sc = ahc->seep_config; sc = ahc->seep_config;
if (bootverbose) if (bootverbose)
printf("%s: Reading SEEPROM...", ahc_name(ahc)); printk("%s: Reading SEEPROM...", ahc_name(ahc));
have_seeprom = ahc_read_seeprom(&sd, (uint16_t *)sc, have_seeprom = ahc_read_seeprom(&sd, (uint16_t *)sc,
/*start_addr*/0, sizeof(*sc)/2); /*start_addr*/0, sizeof(*sc)/2);
...@@ -301,16 +301,16 @@ aha2840_load_seeprom(struct ahc_softc *ahc) ...@@ -301,16 +301,16 @@ aha2840_load_seeprom(struct ahc_softc *ahc)
if (ahc_verify_cksum(sc) == 0) { if (ahc_verify_cksum(sc) == 0) {
if(bootverbose) if(bootverbose)
printf ("checksum error\n"); printk ("checksum error\n");
have_seeprom = 0; have_seeprom = 0;
} else if (bootverbose) { } else if (bootverbose) {
printf("done.\n"); printk("done.\n");
} }
} }
if (!have_seeprom) { if (!have_seeprom) {
if (bootverbose) if (bootverbose)
printf("%s: No SEEPROM available\n", ahc_name(ahc)); printk("%s: No SEEPROM available\n", ahc_name(ahc));
ahc->flags |= AHC_USEDEFAULTS; ahc->flags |= AHC_USEDEFAULTS;
} else { } else {
/* /*
......
...@@ -85,7 +85,7 @@ aic7770_probe(struct device *dev) ...@@ -85,7 +85,7 @@ aic7770_probe(struct device *dev)
int error; int error;
sprintf(buf, "ahc_eisa:%d", eisaBase >> 12); sprintf(buf, "ahc_eisa:%d", eisaBase >> 12);
name = malloc(strlen(buf) + 1, M_DEVBUF, M_NOWAIT); name = kmalloc(strlen(buf) + 1, GFP_ATOMIC);
if (name == NULL) if (name == NULL)
return (ENOMEM); return (ENOMEM);
strcpy(name, buf); strcpy(name, buf);
......
This diff is collapsed.
This diff is collapsed.
...@@ -363,13 +363,6 @@ struct ahd_platform_data { ...@@ -363,13 +363,6 @@ struct ahd_platform_data {
resource_size_t mem_busaddr; /* Mem Base Addr */ resource_size_t mem_busaddr; /* Mem Base Addr */
}; };
/************************** OS Utility Wrappers *******************************/
#define printf printk
#define M_NOWAIT GFP_ATOMIC
#define M_WAITOK 0
#define malloc(size, type, flags) kmalloc(size, flags)
#define free(ptr, type) kfree(ptr)
void ahd_delay(long); void ahd_delay(long);
/***************************** Low Level I/O **********************************/ /***************************** Low Level I/O **********************************/
......
...@@ -178,7 +178,7 @@ ahd_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -178,7 +178,7 @@ ahd_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
ahd_get_pci_bus(pci), ahd_get_pci_bus(pci),
ahd_get_pci_slot(pci), ahd_get_pci_slot(pci),
ahd_get_pci_function(pci)); ahd_get_pci_function(pci));
name = malloc(strlen(buf) + 1, M_DEVBUF, M_NOWAIT); name = kmalloc(strlen(buf) + 1, GFP_ATOMIC);
if (name == NULL) if (name == NULL)
return (-ENOMEM); return (-ENOMEM);
strcpy(name, buf); strcpy(name, buf);
...@@ -333,7 +333,7 @@ ahd_pci_map_registers(struct ahd_softc *ahd) ...@@ -333,7 +333,7 @@ ahd_pci_map_registers(struct ahd_softc *ahd)
if (ahd_pci_test_register_access(ahd) != 0) { if (ahd_pci_test_register_access(ahd) != 0) {
printf("aic79xx: PCI Device %d:%d:%d " printk("aic79xx: PCI Device %d:%d:%d "
"failed memory mapped test. Using PIO.\n", "failed memory mapped test. Using PIO.\n",
ahd_get_pci_bus(ahd->dev_softc), ahd_get_pci_bus(ahd->dev_softc),
ahd_get_pci_slot(ahd->dev_softc), ahd_get_pci_slot(ahd->dev_softc),
...@@ -346,7 +346,7 @@ ahd_pci_map_registers(struct ahd_softc *ahd) ...@@ -346,7 +346,7 @@ ahd_pci_map_registers(struct ahd_softc *ahd)
} else } else
command |= PCIM_CMD_MEMEN; command |= PCIM_CMD_MEMEN;
} else if (bootverbose) { } else if (bootverbose) {
printf("aic79xx: PCI%d:%d:%d MEM region 0x%llx " printk("aic79xx: PCI%d:%d:%d MEM region 0x%llx "
"unavailable. Cannot memory map device.\n", "unavailable. Cannot memory map device.\n",
ahd_get_pci_bus(ahd->dev_softc), ahd_get_pci_bus(ahd->dev_softc),
ahd_get_pci_slot(ahd->dev_softc), ahd_get_pci_slot(ahd->dev_softc),
...@@ -365,7 +365,7 @@ ahd_pci_map_registers(struct ahd_softc *ahd) ...@@ -365,7 +365,7 @@ ahd_pci_map_registers(struct ahd_softc *ahd)
ahd->bshs[1].ioport = (u_long)base2; ahd->bshs[1].ioport = (u_long)base2;
command |= PCIM_CMD_PORTEN; command |= PCIM_CMD_PORTEN;
} else { } else {
printf("aic79xx: PCI%d:%d:%d IO regions 0x%llx and " printk("aic79xx: PCI%d:%d:%d IO regions 0x%llx and "
"0x%llx unavailable. Cannot map device.\n", "0x%llx unavailable. Cannot map device.\n",
ahd_get_pci_bus(ahd->dev_softc), ahd_get_pci_bus(ahd->dev_softc),
ahd_get_pci_slot(ahd->dev_softc), ahd_get_pci_slot(ahd->dev_softc),
......
...@@ -338,7 +338,7 @@ ahd_pci_config(struct ahd_softc *ahd, const struct ahd_pci_identity *entry) ...@@ -338,7 +338,7 @@ ahd_pci_config(struct ahd_softc *ahd, const struct ahd_pci_identity *entry)
*/ */
if ((ahd->flags & (AHD_39BIT_ADDRESSING|AHD_64BIT_ADDRESSING)) != 0) { if ((ahd->flags & (AHD_39BIT_ADDRESSING|AHD_64BIT_ADDRESSING)) != 0) {
if (bootverbose) if (bootverbose)
printf("%s: Enabling 39Bit Addressing\n", printk("%s: Enabling 39Bit Addressing\n",
ahd_name(ahd)); ahd_name(ahd));
devconfig = ahd_pci_read_config(ahd->dev_softc, devconfig = ahd_pci_read_config(ahd->dev_softc,
DEVCONFIG, /*bytes*/4); DEVCONFIG, /*bytes*/4);
...@@ -528,7 +528,7 @@ ahd_check_extport(struct ahd_softc *ahd) ...@@ -528,7 +528,7 @@ ahd_check_extport(struct ahd_softc *ahd)
* Fetch VPD for this function and parse it. * Fetch VPD for this function and parse it.
*/ */
if (bootverbose) if (bootverbose)
printf("%s: Reading VPD from SEEPROM...", printk("%s: Reading VPD from SEEPROM...",
ahd_name(ahd)); ahd_name(ahd));
/* Address is always in units of 16bit words */ /* Address is always in units of 16bit words */
...@@ -541,12 +541,12 @@ ahd_check_extport(struct ahd_softc *ahd) ...@@ -541,12 +541,12 @@ ahd_check_extport(struct ahd_softc *ahd)
if (error == 0) if (error == 0)
error = ahd_parse_vpddata(ahd, &vpd); error = ahd_parse_vpddata(ahd, &vpd);
if (bootverbose) if (bootverbose)
printf("%s: VPD parsing %s\n", printk("%s: VPD parsing %s\n",
ahd_name(ahd), ahd_name(ahd),
error == 0 ? "successful" : "failed"); error == 0 ? "successful" : "failed");
if (bootverbose) if (bootverbose)
printf("%s: Reading SEEPROM...", ahd_name(ahd)); printk("%s: Reading SEEPROM...", ahd_name(ahd));
/* Address is always in units of 16bit words */ /* Address is always in units of 16bit words */
start_addr = (sizeof(*sc) / 2) * (ahd->channel - 'A'); start_addr = (sizeof(*sc) / 2) * (ahd->channel - 'A');
...@@ -556,16 +556,16 @@ ahd_check_extport(struct ahd_softc *ahd) ...@@ -556,16 +556,16 @@ ahd_check_extport(struct ahd_softc *ahd)
/*bytestream*/FALSE); /*bytestream*/FALSE);
if (error != 0) { if (error != 0) {
printf("Unable to read SEEPROM\n"); printk("Unable to read SEEPROM\n");
have_seeprom = 0; have_seeprom = 0;
} else { } else {
have_seeprom = ahd_verify_cksum(sc); have_seeprom = ahd_verify_cksum(sc);
if (bootverbose) { if (bootverbose) {
if (have_seeprom == 0) if (have_seeprom == 0)
printf ("checksum error\n"); printk ("checksum error\n");
else else
printf ("done.\n"); printk ("done.\n");
} }
} }
ahd_release_seeprom(ahd); ahd_release_seeprom(ahd);
...@@ -615,21 +615,21 @@ ahd_check_extport(struct ahd_softc *ahd) ...@@ -615,21 +615,21 @@ ahd_check_extport(struct ahd_softc *ahd)
uint16_t *sc_data; uint16_t *sc_data;
int i; int i;
printf("%s: Seeprom Contents:", ahd_name(ahd)); printk("%s: Seeprom Contents:", ahd_name(ahd));
sc_data = (uint16_t *)sc; sc_data = (uint16_t *)sc;
for (i = 0; i < (sizeof(*sc)); i += 2) for (i = 0; i < (sizeof(*sc)); i += 2)
printf("\n\t0x%.4x", sc_data[i]); printk("\n\t0x%.4x", sc_data[i]);
printf("\n"); printk("\n");
} }
#endif #endif
if (!have_seeprom) { if (!have_seeprom) {
if (bootverbose) if (bootverbose)
printf("%s: No SEEPROM available.\n", ahd_name(ahd)); printk("%s: No SEEPROM available.\n", ahd_name(ahd));
ahd->flags |= AHD_USEDEFAULTS; ahd->flags |= AHD_USEDEFAULTS;
error = ahd_default_config(ahd); error = ahd_default_config(ahd);
adapter_control = CFAUTOTERM|CFSEAUTOTERM; adapter_control = CFAUTOTERM|CFSEAUTOTERM;
free(ahd->seep_config, M_DEVBUF); kfree(ahd->seep_config);
ahd->seep_config = NULL; ahd->seep_config = NULL;
} else { } else {
error = ahd_parse_cfgdata(ahd, sc); error = ahd_parse_cfgdata(ahd, sc);
...@@ -656,7 +656,7 @@ ahd_configure_termination(struct ahd_softc *ahd, u_int adapter_control) ...@@ -656,7 +656,7 @@ ahd_configure_termination(struct ahd_softc *ahd, u_int adapter_control)
if ((ahd->flags & AHD_STPWLEVEL_A) != 0) if ((ahd->flags & AHD_STPWLEVEL_A) != 0)
devconfig |= STPWLEVEL; devconfig |= STPWLEVEL;
if (bootverbose) if (bootverbose)
printf("%s: STPWLEVEL is %s\n", printk("%s: STPWLEVEL is %s\n",
ahd_name(ahd), (devconfig & STPWLEVEL) ? "on" : "off"); ahd_name(ahd), (devconfig & STPWLEVEL) ? "on" : "off");
ahd_pci_write_config(ahd->dev_softc, DEVCONFIG, devconfig, /*bytes*/4); ahd_pci_write_config(ahd->dev_softc, DEVCONFIG, devconfig, /*bytes*/4);
...@@ -671,7 +671,7 @@ ahd_configure_termination(struct ahd_softc *ahd, u_int adapter_control) ...@@ -671,7 +671,7 @@ ahd_configure_termination(struct ahd_softc *ahd, u_int adapter_control)
error = ahd_read_flexport(ahd, FLXADDR_TERMCTL, &termctl); error = ahd_read_flexport(ahd, FLXADDR_TERMCTL, &termctl);
if ((adapter_control & CFAUTOTERM) == 0) { if ((adapter_control & CFAUTOTERM) == 0) {
if (bootverbose) if (bootverbose)
printf("%s: Manual Primary Termination\n", printk("%s: Manual Primary Termination\n",
ahd_name(ahd)); ahd_name(ahd));
termctl &= ~(FLX_TERMCTL_ENPRILOW|FLX_TERMCTL_ENPRIHIGH); termctl &= ~(FLX_TERMCTL_ENPRILOW|FLX_TERMCTL_ENPRIHIGH);
if ((adapter_control & CFSTERM) != 0) if ((adapter_control & CFSTERM) != 0)
...@@ -679,14 +679,14 @@ ahd_configure_termination(struct ahd_softc *ahd, u_int adapter_control) ...@@ -679,14 +679,14 @@ ahd_configure_termination(struct ahd_softc *ahd, u_int adapter_control)
if ((adapter_control & CFWSTERM) != 0) if ((adapter_control & CFWSTERM) != 0)
termctl |= FLX_TERMCTL_ENPRIHIGH; termctl |= FLX_TERMCTL_ENPRIHIGH;
} else if (error != 0) { } else if (error != 0) {
printf("%s: Primary Auto-Term Sensing failed! " printk("%s: Primary Auto-Term Sensing failed! "
"Using Defaults.\n", ahd_name(ahd)); "Using Defaults.\n", ahd_name(ahd));
termctl = FLX_TERMCTL_ENPRILOW|FLX_TERMCTL_ENPRIHIGH; termctl = FLX_TERMCTL_ENPRILOW|FLX_TERMCTL_ENPRIHIGH;
} }
if ((adapter_control & CFSEAUTOTERM) == 0) { if ((adapter_control & CFSEAUTOTERM) == 0) {
if (bootverbose) if (bootverbose)
printf("%s: Manual Secondary Termination\n", printk("%s: Manual Secondary Termination\n",
ahd_name(ahd)); ahd_name(ahd));
termctl &= ~(FLX_TERMCTL_ENSECLOW|FLX_TERMCTL_ENSECHIGH); termctl &= ~(FLX_TERMCTL_ENSECLOW|FLX_TERMCTL_ENSECHIGH);
if ((adapter_control & CFSELOWTERM) != 0) if ((adapter_control & CFSELOWTERM) != 0)
...@@ -694,7 +694,7 @@ ahd_configure_termination(struct ahd_softc *ahd, u_int adapter_control) ...@@ -694,7 +694,7 @@ ahd_configure_termination(struct ahd_softc *ahd, u_int adapter_control)
if ((adapter_control & CFSEHIGHTERM) != 0) if ((adapter_control & CFSEHIGHTERM) != 0)
termctl |= FLX_TERMCTL_ENSECHIGH; termctl |= FLX_TERMCTL_ENSECHIGH;
} else if (error != 0) { } else if (error != 0) {
printf("%s: Secondary Auto-Term Sensing failed! " printk("%s: Secondary Auto-Term Sensing failed! "
"Using Defaults.\n", ahd_name(ahd)); "Using Defaults.\n", ahd_name(ahd));
termctl |= FLX_TERMCTL_ENSECLOW|FLX_TERMCTL_ENSECHIGH; termctl |= FLX_TERMCTL_ENSECLOW|FLX_TERMCTL_ENSECHIGH;
} }
...@@ -714,22 +714,22 @@ ahd_configure_termination(struct ahd_softc *ahd, u_int adapter_control) ...@@ -714,22 +714,22 @@ ahd_configure_termination(struct ahd_softc *ahd, u_int adapter_control)
error = ahd_write_flexport(ahd, FLXADDR_TERMCTL, termctl); error = ahd_write_flexport(ahd, FLXADDR_TERMCTL, termctl);
if (error != 0) { if (error != 0) {
printf("%s: Unable to set termination settings!\n", printk("%s: Unable to set termination settings!\n",
ahd_name(ahd)); ahd_name(ahd));
} else if (bootverbose) { } else if (bootverbose) {
printf("%s: Primary High byte termination %sabled\n", printk("%s: Primary High byte termination %sabled\n",
ahd_name(ahd), ahd_name(ahd),
(termctl & FLX_TERMCTL_ENPRIHIGH) ? "En" : "Dis"); (termctl & FLX_TERMCTL_ENPRIHIGH) ? "En" : "Dis");
printf("%s: Primary Low byte termination %sabled\n", printk("%s: Primary Low byte termination %sabled\n",
ahd_name(ahd), ahd_name(ahd),
(termctl & FLX_TERMCTL_ENPRILOW) ? "En" : "Dis"); (termctl & FLX_TERMCTL_ENPRILOW) ? "En" : "Dis");
printf("%s: Secondary High byte termination %sabled\n", printk("%s: Secondary High byte termination %sabled\n",
ahd_name(ahd), ahd_name(ahd),
(termctl & FLX_TERMCTL_ENSECHIGH) ? "En" : "Dis"); (termctl & FLX_TERMCTL_ENSECHIGH) ? "En" : "Dis");
printf("%s: Secondary Low byte termination %sabled\n", printk("%s: Secondary Low byte termination %sabled\n",
ahd_name(ahd), ahd_name(ahd),
(termctl & FLX_TERMCTL_ENSECLOW) ? "En" : "Dis"); (termctl & FLX_TERMCTL_ENSECLOW) ? "En" : "Dis");
} }
...@@ -805,7 +805,7 @@ ahd_pci_intr(struct ahd_softc *ahd) ...@@ -805,7 +805,7 @@ ahd_pci_intr(struct ahd_softc *ahd)
if ((intstat & PCIINT) == 0) if ((intstat & PCIINT) == 0)
return; return;
printf("%s: PCI error Interrupt\n", ahd_name(ahd)); printk("%s: PCI error Interrupt\n", ahd_name(ahd));
saved_modes = ahd_save_modes(ahd); saved_modes = ahd_save_modes(ahd);
ahd_dump_card_state(ahd); ahd_dump_card_state(ahd);
ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG); ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
...@@ -832,7 +832,7 @@ ahd_pci_intr(struct ahd_softc *ahd) ...@@ -832,7 +832,7 @@ ahd_pci_intr(struct ahd_softc *ahd)
s = pci_status_strings[bit]; s = pci_status_strings[bit];
if (i == 7/*TARG*/ && bit == 3) if (i == 7/*TARG*/ && bit == 3)
s = "%s: Signaled Target Abort\n"; s = "%s: Signaled Target Abort\n";
printf(s, ahd_name(ahd), pci_status_source[i]); printk(s, ahd_name(ahd), pci_status_source[i]);
} }
} }
} }
...@@ -862,7 +862,7 @@ ahd_pci_split_intr(struct ahd_softc *ahd, u_int intstat) ...@@ -862,7 +862,7 @@ ahd_pci_split_intr(struct ahd_softc *ahd, u_int intstat)
*/ */
pcix_status = ahd_pci_read_config(ahd->dev_softc, PCIXR_STATUS, pcix_status = ahd_pci_read_config(ahd->dev_softc, PCIXR_STATUS,
/*bytes*/2); /*bytes*/2);
printf("%s: PCI Split Interrupt - PCI-X status = 0x%x\n", printk("%s: PCI Split Interrupt - PCI-X status = 0x%x\n",
ahd_name(ahd), pcix_status); ahd_name(ahd), pcix_status);
saved_modes = ahd_save_modes(ahd); saved_modes = ahd_save_modes(ahd);
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
...@@ -891,7 +891,7 @@ ahd_pci_split_intr(struct ahd_softc *ahd, u_int intstat) ...@@ -891,7 +891,7 @@ ahd_pci_split_intr(struct ahd_softc *ahd, u_int intstat)
static const char *s; static const char *s;
s = split_status_strings[bit]; s = split_status_strings[bit];
printf(s, ahd_name(ahd), printk(s, ahd_name(ahd),
split_status_source[i]); split_status_source[i]);
} }
...@@ -902,7 +902,7 @@ ahd_pci_split_intr(struct ahd_softc *ahd, u_int intstat) ...@@ -902,7 +902,7 @@ ahd_pci_split_intr(struct ahd_softc *ahd, u_int intstat)
static const char *s; static const char *s;
s = split_status_strings[bit]; s = split_status_strings[bit];
printf(s, ahd_name(ahd), "SG"); printk(s, ahd_name(ahd), "SG");
} }
} }
} }
...@@ -950,7 +950,7 @@ ahd_aic790X_setup(struct ahd_softc *ahd) ...@@ -950,7 +950,7 @@ ahd_aic790X_setup(struct ahd_softc *ahd)
pci = ahd->dev_softc; pci = ahd->dev_softc;
rev = ahd_pci_read_config(pci, PCIR_REVID, /*bytes*/1); rev = ahd_pci_read_config(pci, PCIR_REVID, /*bytes*/1);
if (rev < ID_AIC7902_PCI_REV_A4) { if (rev < ID_AIC7902_PCI_REV_A4) {
printf("%s: Unable to attach to unsupported chip revision %d\n", printk("%s: Unable to attach to unsupported chip revision %d\n",
ahd_name(ahd), rev); ahd_name(ahd), rev);
ahd_pci_write_config(pci, PCIR_COMMAND, 0, /*bytes*/2); ahd_pci_write_config(pci, PCIR_COMMAND, 0, /*bytes*/2);
return (ENXIO); return (ENXIO);
......
...@@ -272,33 +272,32 @@ ahd_proc_write_seeprom(struct ahd_softc *ahd, char *buffer, int length) ...@@ -272,33 +272,32 @@ ahd_proc_write_seeprom(struct ahd_softc *ahd, char *buffer, int length)
saved_modes = ahd_save_modes(ahd); saved_modes = ahd_save_modes(ahd);
ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
if (length != sizeof(struct seeprom_config)) { if (length != sizeof(struct seeprom_config)) {
printf("ahd_proc_write_seeprom: incorrect buffer size\n"); printk("ahd_proc_write_seeprom: incorrect buffer size\n");
goto done; goto done;
} }
have_seeprom = ahd_verify_cksum((struct seeprom_config*)buffer); have_seeprom = ahd_verify_cksum((struct seeprom_config*)buffer);
if (have_seeprom == 0) { if (have_seeprom == 0) {
printf("ahd_proc_write_seeprom: cksum verification failed\n"); printk("ahd_proc_write_seeprom: cksum verification failed\n");
goto done; goto done;
} }
have_seeprom = ahd_acquire_seeprom(ahd); have_seeprom = ahd_acquire_seeprom(ahd);
if (!have_seeprom) { if (!have_seeprom) {
printf("ahd_proc_write_seeprom: No Serial EEPROM\n"); printk("ahd_proc_write_seeprom: No Serial EEPROM\n");
goto done; goto done;
} else { } else {
u_int start_addr; u_int start_addr;
if (ahd->seep_config == NULL) { if (ahd->seep_config == NULL) {
ahd->seep_config = malloc(sizeof(*ahd->seep_config), ahd->seep_config = kmalloc(sizeof(*ahd->seep_config), GFP_ATOMIC);
M_DEVBUF, M_NOWAIT);
if (ahd->seep_config == NULL) { if (ahd->seep_config == NULL) {
printf("aic79xx: Unable to allocate serial " printk("aic79xx: Unable to allocate serial "
"eeprom buffer. Write failing\n"); "eeprom buffer. Write failing\n");
goto done; goto done;
} }
} }
printf("aic79xx: Writing Serial EEPROM\n"); printk("aic79xx: Writing Serial EEPROM\n");
start_addr = 32 * (ahd->channel - 'A'); start_addr = 32 * (ahd->channel - 'A');
ahd_write_seeprom(ahd, (u_int16_t *)buffer, start_addr, ahd_write_seeprom(ahd, (u_int16_t *)buffer, start_addr,
sizeof(struct seeprom_config)/2); sizeof(struct seeprom_config)/2);
......
...@@ -207,14 +207,14 @@ ahc_read_seeprom(struct seeprom_descriptor *sd, uint16_t *buf, ...@@ -207,14 +207,14 @@ ahc_read_seeprom(struct seeprom_descriptor *sd, uint16_t *buf,
reset_seeprom(sd); reset_seeprom(sd);
} }
#ifdef AHC_DUMP_EEPROM #ifdef AHC_DUMP_EEPROM
printf("\nSerial EEPROM:\n\t"); printk("\nSerial EEPROM:\n\t");
for (k = 0; k < count; k = k + 1) { for (k = 0; k < count; k = k + 1) {
if (((k % 8) == 0) && (k != 0)) { if (((k % 8) == 0) && (k != 0)) {
printf ("\n\t"); printk(KERN_CONT "\n\t");
} }
printf (" 0x%x", buf[k]); printk(KERN_CONT " 0x%x", buf[k]);
} }
printf ("\n"); printk(KERN_CONT "\n");
#endif #endif
return (1); return (1);
} }
...@@ -240,7 +240,7 @@ ahc_write_seeprom(struct seeprom_descriptor *sd, uint16_t *buf, ...@@ -240,7 +240,7 @@ ahc_write_seeprom(struct seeprom_descriptor *sd, uint16_t *buf,
ewen = &seeprom_long_ewen; ewen = &seeprom_long_ewen;
ewds = &seeprom_long_ewds; ewds = &seeprom_long_ewds;
} else { } else {
printf("ahc_write_seeprom: unsupported seeprom type %d\n", printk("ahc_write_seeprom: unsupported seeprom type %d\n",
sd->sd_chip); sd->sd_chip);
return (0); return (0);
} }
......
This diff is collapsed.
...@@ -653,7 +653,7 @@ ahc_linux_slave_alloc(struct scsi_device *sdev) ...@@ -653,7 +653,7 @@ ahc_linux_slave_alloc(struct scsi_device *sdev)
struct ahc_linux_device *dev; struct ahc_linux_device *dev;
if (bootverbose) if (bootverbose)
printf("%s: Slave Alloc %d\n", ahc_name(ahc), sdev->id); printk("%s: Slave Alloc %d\n", ahc_name(ahc), sdev->id);
dev = scsi_transport_device_data(sdev); dev = scsi_transport_device_data(sdev);
memset(dev, 0, sizeof(*dev)); memset(dev, 0, sizeof(*dev));
...@@ -755,7 +755,7 @@ ahc_linux_abort(struct scsi_cmnd *cmd) ...@@ -755,7 +755,7 @@ ahc_linux_abort(struct scsi_cmnd *cmd)
error = ahc_linux_queue_recovery_cmd(cmd, SCB_ABORT); error = ahc_linux_queue_recovery_cmd(cmd, SCB_ABORT);
if (error != 0) if (error != 0)
printf("aic7xxx_abort returns 0x%x\n", error); printk("aic7xxx_abort returns 0x%x\n", error);
return (error); return (error);
} }
...@@ -769,7 +769,7 @@ ahc_linux_dev_reset(struct scsi_cmnd *cmd) ...@@ -769,7 +769,7 @@ ahc_linux_dev_reset(struct scsi_cmnd *cmd)
error = ahc_linux_queue_recovery_cmd(cmd, SCB_DEVICE_RESET); error = ahc_linux_queue_recovery_cmd(cmd, SCB_DEVICE_RESET);
if (error != 0) if (error != 0)
printf("aic7xxx_dev_reset returns 0x%x\n", error); printk("aic7xxx_dev_reset returns 0x%x\n", error);
return (error); return (error);
} }
...@@ -791,7 +791,7 @@ ahc_linux_bus_reset(struct scsi_cmnd *cmd) ...@@ -791,7 +791,7 @@ ahc_linux_bus_reset(struct scsi_cmnd *cmd)
ahc_unlock(ahc, &flags); ahc_unlock(ahc, &flags);
if (bootverbose) if (bootverbose)
printf("%s: SCSI bus reset delivered. " printk("%s: SCSI bus reset delivered. "
"%d SCBs aborted.\n", ahc_name(ahc), found); "%d SCBs aborted.\n", ahc_name(ahc), found);
return SUCCESS; return SUCCESS;
...@@ -840,7 +840,7 @@ ahc_dma_tag_create(struct ahc_softc *ahc, bus_dma_tag_t parent, ...@@ -840,7 +840,7 @@ ahc_dma_tag_create(struct ahc_softc *ahc, bus_dma_tag_t parent,
{ {
bus_dma_tag_t dmat; bus_dma_tag_t dmat;
dmat = malloc(sizeof(*dmat), M_DEVBUF, M_NOWAIT); dmat = kmalloc(sizeof(*dmat), GFP_ATOMIC);
if (dmat == NULL) if (dmat == NULL)
return (ENOMEM); return (ENOMEM);
...@@ -861,7 +861,7 @@ ahc_dma_tag_create(struct ahc_softc *ahc, bus_dma_tag_t parent, ...@@ -861,7 +861,7 @@ ahc_dma_tag_create(struct ahc_softc *ahc, bus_dma_tag_t parent,
void void
ahc_dma_tag_destroy(struct ahc_softc *ahc, bus_dma_tag_t dmat) ahc_dma_tag_destroy(struct ahc_softc *ahc, bus_dma_tag_t dmat)
{ {
free(dmat, M_DEVBUF); kfree(dmat);
} }
int int
...@@ -918,7 +918,7 @@ ahc_linux_setup_tag_info_global(char *p) ...@@ -918,7 +918,7 @@ ahc_linux_setup_tag_info_global(char *p)
int tags, i, j; int tags, i, j;
tags = simple_strtoul(p + 1, NULL, 0) & 0xff; tags = simple_strtoul(p + 1, NULL, 0) & 0xff;
printf("Setting Global Tags= %d\n", tags); printk("Setting Global Tags= %d\n", tags);
for (i = 0; i < ARRAY_SIZE(aic7xxx_tag_info); i++) { for (i = 0; i < ARRAY_SIZE(aic7xxx_tag_info); i++) {
for (j = 0; j < AHC_NUM_TARGETS; j++) { 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,7 +936,7 @@ ahc_linux_setup_tag_info(u_long arg, int instance, int targ, int32_t value)
&& (targ < AHC_NUM_TARGETS)) { && (targ < AHC_NUM_TARGETS)) {
aic7xxx_tag_info[instance].tag_commands[targ] = value & 0xff; aic7xxx_tag_info[instance].tag_commands[targ] = value & 0xff;
if (bootverbose) if (bootverbose)
printf("tag_info[%d:%d] = %d\n", instance, targ, value); printk("tag_info[%d:%d] = %d\n", instance, targ, value);
} }
} }
...@@ -977,7 +977,7 @@ ahc_parse_brace_option(char *opt_name, char *opt_arg, char *end, int depth, ...@@ -977,7 +977,7 @@ ahc_parse_brace_option(char *opt_name, char *opt_arg, char *end, int depth,
if (targ == -1) if (targ == -1)
targ = 0; targ = 0;
} else { } else {
printf("Malformed Option %s\n", printk("Malformed Option %s\n",
opt_name); opt_name);
done = TRUE; done = TRUE;
} }
...@@ -1120,7 +1120,7 @@ ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *templa ...@@ -1120,7 +1120,7 @@ ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *templa
ahc_set_unit(ahc, ahc_linux_unit++); ahc_set_unit(ahc, ahc_linux_unit++);
ahc_unlock(ahc, &s); ahc_unlock(ahc, &s);
sprintf(buf, "scsi%d", host->host_no); sprintf(buf, "scsi%d", host->host_no);
new_name = malloc(strlen(buf) + 1, M_DEVBUF, M_NOWAIT); new_name = kmalloc(strlen(buf) + 1, GFP_ATOMIC);
if (new_name != NULL) { if (new_name != NULL) {
strcpy(new_name, buf); strcpy(new_name, buf);
ahc_set_name(ahc, new_name); ahc_set_name(ahc, new_name);
...@@ -1220,7 +1220,7 @@ ahc_platform_alloc(struct ahc_softc *ahc, void *platform_arg) ...@@ -1220,7 +1220,7 @@ ahc_platform_alloc(struct ahc_softc *ahc, void *platform_arg)
{ {
ahc->platform_data = ahc->platform_data =
malloc(sizeof(struct ahc_platform_data), M_DEVBUF, M_NOWAIT); kmalloc(sizeof(struct ahc_platform_data), GFP_ATOMIC);
if (ahc->platform_data == NULL) if (ahc->platform_data == NULL)
return (ENOMEM); return (ENOMEM);
memset(ahc->platform_data, 0, sizeof(struct ahc_platform_data)); memset(ahc->platform_data, 0, sizeof(struct ahc_platform_data));
...@@ -1264,7 +1264,7 @@ ahc_platform_free(struct ahc_softc *ahc) ...@@ -1264,7 +1264,7 @@ ahc_platform_free(struct ahc_softc *ahc)
if (ahc->platform_data->host) if (ahc->platform_data->host)
scsi_host_put(ahc->platform_data->host); scsi_host_put(ahc->platform_data->host);
free(ahc->platform_data, M_DEVBUF); kfree(ahc->platform_data);
} }
} }
...@@ -1378,7 +1378,7 @@ ahc_linux_user_tagdepth(struct ahc_softc *ahc, struct ahc_devinfo *devinfo) ...@@ -1378,7 +1378,7 @@ ahc_linux_user_tagdepth(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
if (ahc->unit >= ARRAY_SIZE(aic7xxx_tag_info)) { if (ahc->unit >= ARRAY_SIZE(aic7xxx_tag_info)) {
if (warned_user == 0) { if (warned_user == 0) {
printf(KERN_WARNING printk(KERN_WARNING
"aic7xxx: WARNING: Insufficient tag_info instances\n" "aic7xxx: WARNING: Insufficient tag_info instances\n"
"aic7xxx: for installed controllers. Using defaults\n" "aic7xxx: for installed controllers. Using defaults\n"
"aic7xxx: Please update the aic7xxx_tag_info array in\n" "aic7xxx: Please update the aic7xxx_tag_info array in\n"
...@@ -1421,7 +1421,7 @@ ahc_linux_device_queue_depth(struct scsi_device *sdev) ...@@ -1421,7 +1421,7 @@ ahc_linux_device_queue_depth(struct scsi_device *sdev)
ahc_send_async(ahc, devinfo.channel, devinfo.target, ahc_send_async(ahc, devinfo.channel, devinfo.target,
devinfo.lun, AC_TRANSFER_NEG); devinfo.lun, AC_TRANSFER_NEG);
ahc_print_devinfo(ahc, &devinfo); ahc_print_devinfo(ahc, &devinfo);
printf("Tagged Queuing enabled. Depth %d\n", tags); printk("Tagged Queuing enabled. Depth %d\n", tags);
} else { } else {
ahc_platform_set_tags(ahc, sdev, &devinfo, AHC_QUEUE_NONE); ahc_platform_set_tags(ahc, sdev, &devinfo, AHC_QUEUE_NONE);
ahc_send_async(ahc, devinfo.channel, devinfo.target, ahc_send_async(ahc, devinfo.channel, devinfo.target,
...@@ -1735,7 +1735,7 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb) ...@@ -1735,7 +1735,7 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb)
* not have been dispatched to the controller, so * not have been dispatched to the controller, so
* only check the SCB_ACTIVE flag for tagged transactions. * only check the SCB_ACTIVE flag for tagged transactions.
*/ */
printf("SCB %d done'd twice\n", scb->hscb->tag); printk("SCB %d done'd twice\n", scb->hscb->tag);
ahc_dump_card_state(ahc); ahc_dump_card_state(ahc);
panic("Stopping for safety"); panic("Stopping for safety");
} }
...@@ -1765,7 +1765,7 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb) ...@@ -1765,7 +1765,7 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb)
#ifdef AHC_DEBUG #ifdef AHC_DEBUG
if ((ahc_debug & AHC_SHOW_MISC) != 0) { if ((ahc_debug & AHC_SHOW_MISC) != 0) {
ahc_print_path(ahc, scb); ahc_print_path(ahc, scb);
printf("Set CAM_UNCOR_PARITY\n"); printk("Set CAM_UNCOR_PARITY\n");
} }
#endif #endif
ahc_set_transaction_status(scb, CAM_UNCOR_PARITY); ahc_set_transaction_status(scb, CAM_UNCOR_PARITY);
...@@ -1783,12 +1783,12 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb) ...@@ -1783,12 +1783,12 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb)
u_int i; u_int i;
ahc_print_path(ahc, scb); ahc_print_path(ahc, scb);
printf("CDB:"); printk("CDB:");
for (i = 0; i < scb->io_ctx->cmd_len; i++) for (i = 0; i < scb->io_ctx->cmd_len; i++)
printf(" 0x%x", scb->io_ctx->cmnd[i]); printk(" 0x%x", scb->io_ctx->cmnd[i]);
printf("\n"); printk("\n");
ahc_print_path(ahc, scb); ahc_print_path(ahc, scb);
printf("Saw underflow (%ld of %ld bytes). " printk("Saw underflow (%ld of %ld bytes). "
"Treated as error\n", "Treated as error\n",
ahc_get_residual(scb), ahc_get_residual(scb),
ahc_get_transfer_length(scb)); ahc_get_transfer_length(scb));
...@@ -1821,7 +1821,7 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb) ...@@ -1821,7 +1821,7 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb)
dev->commands_since_idle_or_otag = 0; dev->commands_since_idle_or_otag = 0;
if ((scb->flags & SCB_RECOVERY_SCB) != 0) { if ((scb->flags & SCB_RECOVERY_SCB) != 0) {
printf("Recovery SCB completes\n"); printk("Recovery SCB completes\n");
if (ahc_get_transaction_status(scb) == CAM_BDR_SENT if (ahc_get_transaction_status(scb) == CAM_BDR_SENT
|| ahc_get_transaction_status(scb) == CAM_REQ_ABORTED) || ahc_get_transaction_status(scb) == CAM_REQ_ABORTED)
ahc_set_transaction_status(scb, CAM_CMD_TIMEOUT); ahc_set_transaction_status(scb, CAM_CMD_TIMEOUT);
...@@ -1886,14 +1886,14 @@ ahc_linux_handle_scsi_status(struct ahc_softc *ahc, ...@@ -1886,14 +1886,14 @@ ahc_linux_handle_scsi_status(struct ahc_softc *ahc,
if (ahc_debug & AHC_SHOW_SENSE) { if (ahc_debug & AHC_SHOW_SENSE) {
int i; int i;
printf("Copied %d bytes of sense data:", printk("Copied %d bytes of sense data:",
sense_size); sense_size);
for (i = 0; i < sense_size; i++) { for (i = 0; i < sense_size; i++) {
if ((i & 0xF) == 0) if ((i & 0xF) == 0)
printf("\n"); printk("\n");
printf("0x%x ", cmd->sense_buffer[i]); printk("0x%x ", cmd->sense_buffer[i]);
} }
printf("\n"); printk("\n");
} }
#endif #endif
} }
...@@ -1918,7 +1918,7 @@ ahc_linux_handle_scsi_status(struct ahc_softc *ahc, ...@@ -1918,7 +1918,7 @@ ahc_linux_handle_scsi_status(struct ahc_softc *ahc,
dev->openings = 0; dev->openings = 0;
/* /*
ahc_print_path(ahc, scb); ahc_print_path(ahc, scb);
printf("Dropping tag count to %d\n", dev->active); printk("Dropping tag count to %d\n", dev->active);
*/ */
if (dev->active == dev->tags_on_last_queuefull) { if (dev->active == dev->tags_on_last_queuefull) {
...@@ -1935,7 +1935,7 @@ ahc_linux_handle_scsi_status(struct ahc_softc *ahc, ...@@ -1935,7 +1935,7 @@ ahc_linux_handle_scsi_status(struct ahc_softc *ahc,
== AHC_LOCK_TAGS_COUNT) { == AHC_LOCK_TAGS_COUNT) {
dev->maxtags = dev->active; dev->maxtags = dev->active;
ahc_print_path(ahc, scb); ahc_print_path(ahc, scb);
printf("Locking max tag count at %d\n", printk("Locking max tag count at %d\n",
dev->active); dev->active);
} }
} else { } else {
...@@ -2100,10 +2100,10 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag) ...@@ -2100,10 +2100,10 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
scmd_printk(KERN_INFO, cmd, "Attempting to queue a%s message\n", scmd_printk(KERN_INFO, cmd, "Attempting to queue a%s message\n",
flag == SCB_ABORT ? "n ABORT" : " TARGET RESET"); flag == SCB_ABORT ? "n ABORT" : " TARGET RESET");
printf("CDB:"); printk("CDB:");
for (cdb_byte = 0; cdb_byte < cmd->cmd_len; cdb_byte++) for (cdb_byte = 0; cdb_byte < cmd->cmd_len; cdb_byte++)
printf(" 0x%x", cmd->cmnd[cdb_byte]); printk(" 0x%x", cmd->cmnd[cdb_byte]);
printf("\n"); printk("\n");
ahc_lock(ahc, &flags); ahc_lock(ahc, &flags);
...@@ -2121,7 +2121,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag) ...@@ -2121,7 +2121,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
* No target device for this command exists, * No target device for this command exists,
* so we must not still own the command. * so we must not still own the command.
*/ */
printf("%s:%d:%d:%d: Is not an active device\n", printk("%s:%d:%d:%d: Is not an active device\n",
ahc_name(ahc), cmd->device->channel, cmd->device->id, ahc_name(ahc), cmd->device->channel, cmd->device->id,
cmd->device->lun); cmd->device->lun);
retval = SUCCESS; retval = SUCCESS;
...@@ -2133,7 +2133,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag) ...@@ -2133,7 +2133,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
cmd->device->channel + 'A', cmd->device->channel + 'A',
cmd->device->lun, cmd->device->lun,
CAM_REQ_ABORTED, SEARCH_COMPLETE) != 0) { CAM_REQ_ABORTED, SEARCH_COMPLETE) != 0) {
printf("%s:%d:%d:%d: Command found on untagged queue\n", printk("%s:%d:%d:%d: Command found on untagged queue\n",
ahc_name(ahc), cmd->device->channel, cmd->device->id, ahc_name(ahc), cmd->device->channel, cmd->device->id,
cmd->device->lun); cmd->device->lun);
retval = SUCCESS; retval = SUCCESS;
...@@ -2187,7 +2187,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag) ...@@ -2187,7 +2187,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
goto no_cmd; goto no_cmd;
} }
printf("%s: At time of recovery, card was %spaused\n", printk("%s: At time of recovery, card was %spaused\n",
ahc_name(ahc), was_paused ? "" : "not "); ahc_name(ahc), was_paused ? "" : "not ");
ahc_dump_card_state(ahc); ahc_dump_card_state(ahc);
...@@ -2199,7 +2199,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag) ...@@ -2199,7 +2199,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
pending_scb->hscb->tag, pending_scb->hscb->tag,
ROLE_INITIATOR, CAM_REQ_ABORTED, ROLE_INITIATOR, CAM_REQ_ABORTED,
SEARCH_COMPLETE) > 0) { SEARCH_COMPLETE) > 0) {
printf("%s:%d:%d:%d: Cmd aborted from QINFIFO\n", printk("%s:%d:%d:%d: Cmd aborted from QINFIFO\n",
ahc_name(ahc), cmd->device->channel, ahc_name(ahc), cmd->device->channel,
cmd->device->id, cmd->device->lun); cmd->device->id, cmd->device->lun);
retval = SUCCESS; retval = SUCCESS;
...@@ -2313,7 +2313,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag) ...@@ -2313,7 +2313,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
ahc_qinfifo_requeue_tail(ahc, pending_scb); ahc_qinfifo_requeue_tail(ahc, pending_scb);
ahc_outb(ahc, SCBPTR, saved_scbptr); ahc_outb(ahc, SCBPTR, saved_scbptr);
ahc_print_path(ahc, pending_scb); ahc_print_path(ahc, pending_scb);
printf("Device is disconnected, re-queuing SCB\n"); printk("Device is disconnected, re-queuing SCB\n");
wait = TRUE; wait = TRUE;
} else { } else {
scmd_printk(KERN_INFO, cmd, "Unable to deliver message\n"); scmd_printk(KERN_INFO, cmd, "Unable to deliver message\n");
...@@ -2338,16 +2338,16 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag) ...@@ -2338,16 +2338,16 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
ahc->platform_data->eh_done = &done; ahc->platform_data->eh_done = &done;
ahc_unlock(ahc, &flags); ahc_unlock(ahc, &flags);
printf("Recovery code sleeping\n"); printk("Recovery code sleeping\n");
if (!wait_for_completion_timeout(&done, 5 * HZ)) { if (!wait_for_completion_timeout(&done, 5 * HZ)) {
ahc_lock(ahc, &flags); ahc_lock(ahc, &flags);
ahc->platform_data->eh_done = NULL; ahc->platform_data->eh_done = NULL;
ahc_unlock(ahc, &flags); ahc_unlock(ahc, &flags);
printf("Timer Expired\n"); printk("Timer Expired\n");
retval = FAILED; retval = FAILED;
} }
printf("Recovery code awake\n"); printk("Recovery code awake\n");
} else } else
ahc_unlock(ahc, &flags); ahc_unlock(ahc, &flags);
return (retval); return (retval);
......
...@@ -368,13 +368,6 @@ struct ahc_platform_data { ...@@ -368,13 +368,6 @@ struct ahc_platform_data {
resource_size_t mem_busaddr; /* Mem Base Addr */ resource_size_t mem_busaddr; /* Mem Base Addr */
}; };
/************************** OS Utility Wrappers *******************************/
#define printf printk
#define M_NOWAIT GFP_ATOMIC
#define M_WAITOK 0
#define malloc(size, type, flags) kmalloc(size, flags)
#define free(ptr, type) kfree(ptr)
void ahc_delay(long); void ahc_delay(long);
......
...@@ -225,7 +225,7 @@ ahc_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -225,7 +225,7 @@ ahc_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
ahc_get_pci_bus(pci), ahc_get_pci_bus(pci),
ahc_get_pci_slot(pci), ahc_get_pci_slot(pci),
ahc_get_pci_function(pci)); ahc_get_pci_function(pci));
name = malloc(strlen(buf) + 1, M_DEVBUF, M_NOWAIT); name = kmalloc(strlen(buf) + 1, GFP_ATOMIC);
if (name == NULL) if (name == NULL)
return (-ENOMEM); return (-ENOMEM);
strcpy(name, buf); strcpy(name, buf);
...@@ -412,7 +412,7 @@ ahc_pci_map_registers(struct ahc_softc *ahc) ...@@ -412,7 +412,7 @@ ahc_pci_map_registers(struct ahc_softc *ahc)
*/ */
if (ahc_pci_test_register_access(ahc) != 0) { if (ahc_pci_test_register_access(ahc) != 0) {
printf("aic7xxx: PCI Device %d:%d:%d " printk("aic7xxx: PCI Device %d:%d:%d "
"failed memory mapped test. Using PIO.\n", "failed memory mapped test. Using PIO.\n",
ahc_get_pci_bus(ahc->dev_softc), ahc_get_pci_bus(ahc->dev_softc),
ahc_get_pci_slot(ahc->dev_softc), ahc_get_pci_slot(ahc->dev_softc),
...@@ -425,7 +425,7 @@ ahc_pci_map_registers(struct ahc_softc *ahc) ...@@ -425,7 +425,7 @@ ahc_pci_map_registers(struct ahc_softc *ahc)
} else } else
command |= PCIM_CMD_MEMEN; command |= PCIM_CMD_MEMEN;
} else { } else {
printf("aic7xxx: PCI%d:%d:%d MEM region 0x%llx " printk("aic7xxx: PCI%d:%d:%d MEM region 0x%llx "
"unavailable. Cannot memory map device.\n", "unavailable. Cannot memory map device.\n",
ahc_get_pci_bus(ahc->dev_softc), ahc_get_pci_bus(ahc->dev_softc),
ahc_get_pci_slot(ahc->dev_softc), ahc_get_pci_slot(ahc->dev_softc),
...@@ -444,7 +444,7 @@ ahc_pci_map_registers(struct ahc_softc *ahc) ...@@ -444,7 +444,7 @@ ahc_pci_map_registers(struct ahc_softc *ahc)
ahc->bsh.ioport = (u_long)base; ahc->bsh.ioport = (u_long)base;
command |= PCIM_CMD_PORTEN; command |= PCIM_CMD_PORTEN;
} else { } else {
printf("aic7xxx: PCI%d:%d:%d IO region 0x%llx[0..255] " printk("aic7xxx: PCI%d:%d:%d IO region 0x%llx[0..255] "
"unavailable. Cannot map device.\n", "unavailable. Cannot map device.\n",
ahc_get_pci_bus(ahc->dev_softc), ahc_get_pci_bus(ahc->dev_softc),
ahc_get_pci_slot(ahc->dev_softc), ahc_get_pci_slot(ahc->dev_softc),
......
...@@ -752,7 +752,7 @@ ahc_pci_config(struct ahc_softc *ahc, const struct ahc_pci_identity *entry) ...@@ -752,7 +752,7 @@ ahc_pci_config(struct ahc_softc *ahc, const struct ahc_pci_identity *entry)
if ((ahc->flags & AHC_39BIT_ADDRESSING) != 0) { if ((ahc->flags & AHC_39BIT_ADDRESSING) != 0) {
if (bootverbose) if (bootverbose)
printf("%s: Enabling 39Bit Addressing\n", printk("%s: Enabling 39Bit Addressing\n",
ahc_name(ahc)); ahc_name(ahc));
devconfig |= DACEN; devconfig |= DACEN;
} }
...@@ -896,7 +896,7 @@ ahc_pci_config(struct ahc_softc *ahc, const struct ahc_pci_identity *entry) ...@@ -896,7 +896,7 @@ ahc_pci_config(struct ahc_softc *ahc, const struct ahc_pci_identity *entry)
/* See if someone else set us up already */ /* See if someone else set us up already */
if ((ahc->flags & AHC_NO_BIOS_INIT) == 0 if ((ahc->flags & AHC_NO_BIOS_INIT) == 0
&& scsiseq != 0) { && scsiseq != 0) {
printf("%s: Using left over BIOS settings\n", printk("%s: Using left over BIOS settings\n",
ahc_name(ahc)); ahc_name(ahc));
ahc->flags &= ~AHC_USEDEFAULTS; ahc->flags &= ~AHC_USEDEFAULTS;
ahc->flags |= AHC_BIOS_ENABLED; ahc->flags |= AHC_BIOS_ENABLED;
...@@ -1155,7 +1155,7 @@ ahc_probe_ext_scbram(struct ahc_softc *ahc) ...@@ -1155,7 +1155,7 @@ ahc_probe_ext_scbram(struct ahc_softc *ahc)
ahc_outb(ahc, CLRINT, CLRPARERR); ahc_outb(ahc, CLRINT, CLRPARERR);
ahc_outb(ahc, CLRINT, CLRBRKADRINT); ahc_outb(ahc, CLRINT, CLRBRKADRINT);
if (bootverbose && enable) { if (bootverbose && enable) {
printf("%s: External SRAM, %s access%s, %dbytes/SCB\n", printk("%s: External SRAM, %s access%s, %dbytes/SCB\n",
ahc_name(ahc), fast ? "fast" : "slow", ahc_name(ahc), fast ? "fast" : "slow",
pcheck ? ", parity checking enabled" : "", pcheck ? ", parity checking enabled" : "",
large ? 64 : 32); large ? 64 : 32);
...@@ -1292,7 +1292,7 @@ check_extport(struct ahc_softc *ahc, u_int *sxfrctl1) ...@@ -1292,7 +1292,7 @@ check_extport(struct ahc_softc *ahc, u_int *sxfrctl1)
if (have_seeprom) { if (have_seeprom) {
if (bootverbose) if (bootverbose)
printf("%s: Reading SEEPROM...", ahc_name(ahc)); printk("%s: Reading SEEPROM...", ahc_name(ahc));
for (;;) { for (;;) {
u_int start_addr; u_int start_addr;
...@@ -1309,9 +1309,9 @@ check_extport(struct ahc_softc *ahc, u_int *sxfrctl1) ...@@ -1309,9 +1309,9 @@ check_extport(struct ahc_softc *ahc, u_int *sxfrctl1)
if (have_seeprom != 0 || sd.sd_chip == C56_66) { if (have_seeprom != 0 || sd.sd_chip == C56_66) {
if (bootverbose) { if (bootverbose) {
if (have_seeprom == 0) if (have_seeprom == 0)
printf ("checksum error\n"); printk ("checksum error\n");
else else
printf ("done.\n"); printk ("done.\n");
} }
break; break;
} }
...@@ -1362,9 +1362,9 @@ check_extport(struct ahc_softc *ahc, u_int *sxfrctl1) ...@@ -1362,9 +1362,9 @@ check_extport(struct ahc_softc *ahc, u_int *sxfrctl1)
if (!have_seeprom) { if (!have_seeprom) {
if (bootverbose) if (bootverbose)
printf("%s: No SEEPROM available.\n", ahc_name(ahc)); printk("%s: No SEEPROM available.\n", ahc_name(ahc));
ahc->flags |= AHC_USEDEFAULTS; ahc->flags |= AHC_USEDEFAULTS;
free(ahc->seep_config, M_DEVBUF); kfree(ahc->seep_config);
ahc->seep_config = NULL; ahc->seep_config = NULL;
sc = NULL; sc = NULL;
} else { } else {
...@@ -1399,7 +1399,7 @@ check_extport(struct ahc_softc *ahc, u_int *sxfrctl1) ...@@ -1399,7 +1399,7 @@ check_extport(struct ahc_softc *ahc, u_int *sxfrctl1)
if ((sc->adapter_control & CFSTERM) != 0) if ((sc->adapter_control & CFSTERM) != 0)
*sxfrctl1 |= STPWEN; *sxfrctl1 |= STPWEN;
if (bootverbose) if (bootverbose)
printf("%s: Low byte termination %sabled\n", printk("%s: Low byte termination %sabled\n",
ahc_name(ahc), ahc_name(ahc),
(*sxfrctl1 & STPWEN) ? "en" : "dis"); (*sxfrctl1 & STPWEN) ? "en" : "dis");
} }
...@@ -1569,7 +1569,7 @@ configure_termination(struct ahc_softc *ahc, ...@@ -1569,7 +1569,7 @@ configure_termination(struct ahc_softc *ahc,
&eeprom_present); &eeprom_present);
if ((adapter_control & CFSEAUTOTERM) == 0) { if ((adapter_control & CFSEAUTOTERM) == 0) {
if (bootverbose) if (bootverbose)
printf("%s: Manual SE Termination\n", printk("%s: Manual SE Termination\n",
ahc_name(ahc)); ahc_name(ahc));
enableSEC_low = (adapter_control & CFSELOWTERM); enableSEC_low = (adapter_control & CFSELOWTERM);
enableSEC_high = enableSEC_high =
...@@ -1577,7 +1577,7 @@ configure_termination(struct ahc_softc *ahc, ...@@ -1577,7 +1577,7 @@ configure_termination(struct ahc_softc *ahc,
} }
if ((adapter_control & CFAUTOTERM) == 0) { if ((adapter_control & CFAUTOTERM) == 0) {
if (bootverbose) if (bootverbose)
printf("%s: Manual LVD Termination\n", printk("%s: Manual LVD Termination\n",
ahc_name(ahc)); ahc_name(ahc));
enablePRI_low = (adapter_control & CFSTERM); enablePRI_low = (adapter_control & CFSTERM);
enablePRI_high = (adapter_control & CFWSTERM); enablePRI_high = (adapter_control & CFWSTERM);
...@@ -1604,19 +1604,19 @@ configure_termination(struct ahc_softc *ahc, ...@@ -1604,19 +1604,19 @@ configure_termination(struct ahc_softc *ahc,
if (bootverbose if (bootverbose
&& (ahc->features & AHC_ULTRA2) == 0) { && (ahc->features & AHC_ULTRA2) == 0) {
printf("%s: internal 50 cable %s present", printk("%s: internal 50 cable %s present",
ahc_name(ahc), ahc_name(ahc),
internal50_present ? "is":"not"); internal50_present ? "is":"not");
if ((ahc->features & AHC_WIDE) != 0) if ((ahc->features & AHC_WIDE) != 0)
printf(", internal 68 cable %s present", printk(", internal 68 cable %s present",
internal68_present ? "is":"not"); internal68_present ? "is":"not");
printf("\n%s: external cable %s present\n", printk("\n%s: external cable %s present\n",
ahc_name(ahc), ahc_name(ahc),
externalcable_present ? "is":"not"); externalcable_present ? "is":"not");
} }
if (bootverbose) if (bootverbose)
printf("%s: BIOS eeprom %s present\n", printk("%s: BIOS eeprom %s present\n",
ahc_name(ahc), eeprom_present ? "is" : "not"); ahc_name(ahc), eeprom_present ? "is" : "not");
if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0) { if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0) {
...@@ -1642,7 +1642,7 @@ configure_termination(struct ahc_softc *ahc, ...@@ -1642,7 +1642,7 @@ configure_termination(struct ahc_softc *ahc,
&& (internal50_present != 0) && (internal50_present != 0)
&& (internal68_present != 0) && (internal68_present != 0)
&& (externalcable_present != 0)) { && (externalcable_present != 0)) {
printf("%s: Illegal cable configuration!!. " printk("%s: Illegal cable configuration!!. "
"Only two connectors on the " "Only two connectors on the "
"adapter may be used at a " "adapter may be used at a "
"time!\n", ahc_name(ahc)); "time!\n", ahc_name(ahc));
...@@ -1664,10 +1664,10 @@ configure_termination(struct ahc_softc *ahc, ...@@ -1664,10 +1664,10 @@ configure_termination(struct ahc_softc *ahc,
brddat |= BRDDAT6; brddat |= BRDDAT6;
if (bootverbose) { if (bootverbose) {
if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0) if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0)
printf("%s: 68 pin termination " printk("%s: 68 pin termination "
"Enabled\n", ahc_name(ahc)); "Enabled\n", ahc_name(ahc));
else else
printf("%s: %sHigh byte termination " printk("%s: %sHigh byte termination "
"Enabled\n", ahc_name(ahc), "Enabled\n", ahc_name(ahc),
enableSEC_high ? "Secondary " enableSEC_high ? "Secondary "
: ""); : "");
...@@ -1683,10 +1683,10 @@ configure_termination(struct ahc_softc *ahc, ...@@ -1683,10 +1683,10 @@ configure_termination(struct ahc_softc *ahc,
*sxfrctl1 |= STPWEN; *sxfrctl1 |= STPWEN;
if (bootverbose) { if (bootverbose) {
if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0) if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0)
printf("%s: 50 pin termination " printk("%s: 50 pin termination "
"Enabled\n", ahc_name(ahc)); "Enabled\n", ahc_name(ahc));
else else
printf("%s: %sLow byte termination " printk("%s: %sLow byte termination "
"Enabled\n", ahc_name(ahc), "Enabled\n", ahc_name(ahc),
enableSEC_low ? "Secondary " enableSEC_low ? "Secondary "
: ""); : "");
...@@ -1696,7 +1696,7 @@ configure_termination(struct ahc_softc *ahc, ...@@ -1696,7 +1696,7 @@ configure_termination(struct ahc_softc *ahc,
if (enablePRI_low != 0) { if (enablePRI_low != 0) {
*sxfrctl1 |= STPWEN; *sxfrctl1 |= STPWEN;
if (bootverbose) if (bootverbose)
printf("%s: Primary Low Byte termination " printk("%s: Primary Low Byte termination "
"Enabled\n", ahc_name(ahc)); "Enabled\n", ahc_name(ahc));
} }
...@@ -1709,7 +1709,7 @@ configure_termination(struct ahc_softc *ahc, ...@@ -1709,7 +1709,7 @@ configure_termination(struct ahc_softc *ahc,
if (enablePRI_high != 0) { if (enablePRI_high != 0) {
brddat |= BRDDAT4; brddat |= BRDDAT4;
if (bootverbose) if (bootverbose)
printf("%s: Primary High Byte " printk("%s: Primary High Byte "
"termination Enabled\n", "termination Enabled\n",
ahc_name(ahc)); ahc_name(ahc));
} }
...@@ -1721,7 +1721,7 @@ configure_termination(struct ahc_softc *ahc, ...@@ -1721,7 +1721,7 @@ configure_termination(struct ahc_softc *ahc,
*sxfrctl1 |= STPWEN; *sxfrctl1 |= STPWEN;
if (bootverbose) if (bootverbose)
printf("%s: %sLow byte termination Enabled\n", printk("%s: %sLow byte termination Enabled\n",
ahc_name(ahc), ahc_name(ahc),
(ahc->features & AHC_ULTRA2) ? "Primary " (ahc->features & AHC_ULTRA2) ? "Primary "
: ""); : "");
...@@ -1731,7 +1731,7 @@ configure_termination(struct ahc_softc *ahc, ...@@ -1731,7 +1731,7 @@ configure_termination(struct ahc_softc *ahc,
&& (ahc->features & AHC_WIDE) != 0) { && (ahc->features & AHC_WIDE) != 0) {
brddat |= BRDDAT6; brddat |= BRDDAT6;
if (bootverbose) if (bootverbose)
printf("%s: %sHigh byte termination Enabled\n", printk("%s: %sHigh byte termination Enabled\n",
ahc_name(ahc), ahc_name(ahc),
(ahc->features & AHC_ULTRA2) (ahc->features & AHC_ULTRA2)
? "Secondary " : ""); ? "Secondary " : "");
...@@ -1937,29 +1937,29 @@ ahc_pci_intr(struct ahc_softc *ahc) ...@@ -1937,29 +1937,29 @@ ahc_pci_intr(struct ahc_softc *ahc)
status1 = ahc_pci_read_config(ahc->dev_softc, status1 = ahc_pci_read_config(ahc->dev_softc,
PCIR_STATUS + 1, /*bytes*/1); PCIR_STATUS + 1, /*bytes*/1);
printf("%s: PCI error Interrupt at seqaddr = 0x%x\n", printk("%s: PCI error Interrupt at seqaddr = 0x%x\n",
ahc_name(ahc), ahc_name(ahc),
ahc_inb(ahc, SEQADDR0) | (ahc_inb(ahc, SEQADDR1) << 8)); ahc_inb(ahc, SEQADDR0) | (ahc_inb(ahc, SEQADDR1) << 8));
if (status1 & DPE) { if (status1 & DPE) {
ahc->pci_target_perr_count++; ahc->pci_target_perr_count++;
printf("%s: Data Parity Error Detected during address " printk("%s: Data Parity Error Detected during address "
"or write data phase\n", ahc_name(ahc)); "or write data phase\n", ahc_name(ahc));
} }
if (status1 & SSE) { if (status1 & SSE) {
printf("%s: Signal System Error Detected\n", ahc_name(ahc)); printk("%s: Signal System Error Detected\n", ahc_name(ahc));
} }
if (status1 & RMA) { if (status1 & RMA) {
printf("%s: Received a Master Abort\n", ahc_name(ahc)); printk("%s: Received a Master Abort\n", ahc_name(ahc));
} }
if (status1 & RTA) { if (status1 & RTA) {
printf("%s: Received a Target Abort\n", ahc_name(ahc)); printk("%s: Received a Target Abort\n", ahc_name(ahc));
} }
if (status1 & STA) { if (status1 & STA) {
printf("%s: Signaled a Target Abort\n", ahc_name(ahc)); printk("%s: Signaled a Target Abort\n", ahc_name(ahc));
} }
if (status1 & DPR) { if (status1 & DPR) {
printf("%s: Data Parity Error has been reported via PERR#\n", printk("%s: Data Parity Error has been reported via PERR#\n",
ahc_name(ahc)); ahc_name(ahc));
} }
...@@ -1968,14 +1968,14 @@ ahc_pci_intr(struct ahc_softc *ahc) ...@@ -1968,14 +1968,14 @@ ahc_pci_intr(struct ahc_softc *ahc)
status1, /*bytes*/1); status1, /*bytes*/1);
if ((status1 & (DPE|SSE|RMA|RTA|STA|DPR)) == 0) { if ((status1 & (DPE|SSE|RMA|RTA|STA|DPR)) == 0) {
printf("%s: Latched PCIERR interrupt with " printk("%s: Latched PCIERR interrupt with "
"no status bits set\n", ahc_name(ahc)); "no status bits set\n", ahc_name(ahc));
} else { } else {
ahc_outb(ahc, CLRINT, CLRPARERR); ahc_outb(ahc, CLRINT, CLRPARERR);
} }
if (ahc->pci_target_perr_count > AHC_PCI_TARGET_PERR_THRESH) { if (ahc->pci_target_perr_count > AHC_PCI_TARGET_PERR_THRESH) {
printf( printk(
"%s: WARNING WARNING WARNING WARNING\n" "%s: WARNING WARNING WARNING WARNING\n"
"%s: Too many PCI parity errors observed as a target.\n" "%s: Too many PCI parity errors observed as a target.\n"
"%s: Some device on this bus is generating bad parity.\n" "%s: Some device on this bus is generating bad parity.\n"
...@@ -2386,7 +2386,7 @@ ahc_aha29160C_setup(struct ahc_softc *ahc) ...@@ -2386,7 +2386,7 @@ ahc_aha29160C_setup(struct ahc_softc *ahc)
static int static int
ahc_raid_setup(struct ahc_softc *ahc) ahc_raid_setup(struct ahc_softc *ahc)
{ {
printf("RAID functionality unsupported\n"); printk("RAID functionality unsupported\n");
return (ENXIO); return (ENXIO);
} }
...@@ -2404,7 +2404,7 @@ ahc_aha394XX_setup(struct ahc_softc *ahc) ...@@ -2404,7 +2404,7 @@ ahc_aha394XX_setup(struct ahc_softc *ahc)
ahc->channel = 'B'; ahc->channel = 'B';
break; break;
default: default:
printf("adapter at unexpected slot %d\n" printk("adapter at unexpected slot %d\n"
"unable to map to a channel\n", "unable to map to a channel\n",
ahc_get_pci_slot(pci)); ahc_get_pci_slot(pci));
ahc->channel = 'A'; ahc->channel = 'A';
...@@ -2429,7 +2429,7 @@ ahc_aha398XX_setup(struct ahc_softc *ahc) ...@@ -2429,7 +2429,7 @@ ahc_aha398XX_setup(struct ahc_softc *ahc)
ahc->channel = 'C'; ahc->channel = 'C';
break; break;
default: default:
printf("adapter at unexpected slot %d\n" printk("adapter at unexpected slot %d\n"
"unable to map to a channel\n", "unable to map to a channel\n",
ahc_get_pci_slot(pci)); ahc_get_pci_slot(pci));
ahc->channel = 'A'; ahc->channel = 'A';
...@@ -2459,7 +2459,7 @@ ahc_aha494XX_setup(struct ahc_softc *ahc) ...@@ -2459,7 +2459,7 @@ ahc_aha494XX_setup(struct ahc_softc *ahc)
ahc->channel = 'D'; ahc->channel = 'D';
break; break;
default: default:
printf("adapter at unexpected slot %d\n" printk("adapter at unexpected slot %d\n"
"unable to map to a channel\n", "unable to map to a channel\n",
ahc_get_pci_slot(pci)); ahc_get_pci_slot(pci));
ahc->channel = 'A'; ahc->channel = 'A';
......
...@@ -248,13 +248,13 @@ ahc_proc_write_seeprom(struct ahc_softc *ahc, char *buffer, int length) ...@@ -248,13 +248,13 @@ ahc_proc_write_seeprom(struct ahc_softc *ahc, char *buffer, int length)
ahc_pause(ahc); ahc_pause(ahc);
if (length != sizeof(struct seeprom_config)) { if (length != sizeof(struct seeprom_config)) {
printf("ahc_proc_write_seeprom: incorrect buffer size\n"); printk("ahc_proc_write_seeprom: incorrect buffer size\n");
goto done; goto done;
} }
have_seeprom = ahc_verify_cksum((struct seeprom_config*)buffer); have_seeprom = ahc_verify_cksum((struct seeprom_config*)buffer);
if (have_seeprom == 0) { if (have_seeprom == 0) {
printf("ahc_proc_write_seeprom: cksum verification failed\n"); printk("ahc_proc_write_seeprom: cksum verification failed\n");
goto done; goto done;
} }
...@@ -290,26 +290,25 @@ ahc_proc_write_seeprom(struct ahc_softc *ahc, char *buffer, int length) ...@@ -290,26 +290,25 @@ ahc_proc_write_seeprom(struct ahc_softc *ahc, char *buffer, int length)
sd.sd_DI = DI_2840; sd.sd_DI = DI_2840;
have_seeprom = TRUE; have_seeprom = TRUE;
} else { } else {
printf("ahc_proc_write_seeprom: unsupported adapter type\n"); printk("ahc_proc_write_seeprom: unsupported adapter type\n");
goto done; goto done;
} }
if (!have_seeprom) { if (!have_seeprom) {
printf("ahc_proc_write_seeprom: No Serial EEPROM\n"); printk("ahc_proc_write_seeprom: No Serial EEPROM\n");
goto done; goto done;
} else { } else {
u_int start_addr; u_int start_addr;
if (ahc->seep_config == NULL) { if (ahc->seep_config == NULL) {
ahc->seep_config = malloc(sizeof(*ahc->seep_config), ahc->seep_config = kmalloc(sizeof(*ahc->seep_config), GFP_ATOMIC);
M_DEVBUF, M_NOWAIT);
if (ahc->seep_config == NULL) { if (ahc->seep_config == NULL) {
printf("aic7xxx: Unable to allocate serial " printk("aic7xxx: Unable to allocate serial "
"eeprom buffer. Write failing\n"); "eeprom buffer. Write failing\n");
goto done; goto done;
} }
} }
printf("aic7xxx: Writing Serial EEPROM\n"); printk("aic7xxx: Writing Serial EEPROM\n");
start_addr = 32 * (ahc->channel - 'A'); start_addr = 32 * (ahc->channel - 'A');
ahc_write_seeprom(&sd, (u_int16_t *)buffer, start_addr, ahc_write_seeprom(&sd, (u_int16_t *)buffer, start_addr,
sizeof(struct seeprom_config)/2); sizeof(struct seeprom_config)/2);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment