Commit 4eb10382 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] isa_check_signature() finally gone

last callers of isa_check_signature() switched to ioremap() +
check_signature()
Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0936015f
......@@ -266,7 +266,7 @@ static int __init xd_init(void)
/* xd_detect: scan the possible BIOS ROM locations for the signature strings */
static u_char __init xd_detect (u_char *controller, unsigned int *address)
{
u_char i,j,found = 0;
int i, j;
if (xd_override)
{
......@@ -275,15 +275,23 @@ static u_char __init xd_detect (u_char *controller, unsigned int *address)
return(1);
}
for (i = 0; i < (sizeof(xd_bases) / sizeof(xd_bases[0])) && !found; i++)
for (j = 1; j < (sizeof(xd_sigs) / sizeof(xd_sigs[0])) && !found; j++)
if (isa_check_signature(xd_bases[i] + xd_sigs[j].offset,xd_sigs[j].string,strlen(xd_sigs[j].string))) {
for (i = 0; i < (sizeof(xd_bases) / sizeof(xd_bases[0])); i++) {
void __iomem *p = ioremap(xd_bases[i], 0x2000);
if (!p)
continue;
for (j = 1; j < (sizeof(xd_sigs) / sizeof(xd_sigs[0])); j++) {
const char *s = xd_sigs[j].string;
if (check_signature(p + xd_sigs[j].offset, s, strlen(s))) {
*controller = j;
xd_type = j;
*address = xd_bases[i];
found++;
iounmap(p);
return 1;
}
return (found);
}
iounmap(p);
}
return 0;
}
/* do_xd_request: handle an incoming request */
......
......@@ -3830,10 +3830,15 @@ static int __init aha152x_init(void)
if (setup_count<ARRAY_SIZE(setup)) {
#if !defined(SKIP_BIOSTEST)
ok = 0;
for (i = 0; i < ARRAY_SIZE(addresses) && !ok; i++)
for (i = 0; i < ARRAY_SIZE(addresses) && !ok; i++) {
void __iomem *p = ioremap(addresses[i], 0x4000);
if (!p)
continue;
for (j = 0; j<ARRAY_SIZE(signatures) && !ok; j++)
ok = isa_check_signature(addresses[i] + signatures[j].sig_offset,
ok = check_signature(p + signatures[j].sig_offset,
signatures[j].signature, signatures[j].sig_length);
iounmap(p);
}
if (!ok && setup_count == 0)
return 0;
......
......@@ -232,17 +232,25 @@ static int __init dtc_detect(Scsi_Host_Template * tpnt)
base = overrides[current_override].address;
else
for (; !base && (current_base < NO_BASES); ++current_base) {
void __iomem *p;
#if (DTCDEBUG & DTCDEBUG_INIT)
printk("scsi-dtc : probing address %08x\n", bases[current_base].address);
#endif
for (sig = 0; sig < NO_SIGNATURES; ++sig)
if (!bases[current_base].noauto && isa_check_signature(bases[current_base].address + signatures[sig].offset, signatures[sig].string, strlen(signatures[sig].string))) {
if (bases[current_base].noauto)
continue;
p = ioremap(bases[current_base].address, 0x2000);
if (!p)
continue;
for (sig = 0; sig < NO_SIGNATURES; ++sig) {
if (check_signature(p + signatures[sig].offset, signatures[sig].string, strlen(signatures[sig].string))) {
base = bases[current_base].address;
#if (DTCDEBUG & DTCDEBUG_INIT)
printk("scsi-dtc : detected board.\n");
#endif
break;
}
}
iounmap(p);
}
#if defined(DTCDEBUG) && (DTCDEBUG & DTCDEBUG_INIT)
......
......@@ -384,6 +384,7 @@ enum out_port_type {
/* .bss will zero all the static variables below */
static int port_base;
static unsigned long bios_base;
static void __iomem * bios_mem;
static int bios_major;
static int bios_minor;
static int PCI_bus;
......@@ -676,12 +677,15 @@ static int fdomain_isa_detect( int *irq, int *iobase )
printk( "scsi: <fdomain> fdomain_isa_detect:" );
#endif
for (i = 0; !bios_base && i < ADDRESS_COUNT; i++) {
for (i = 0; i < ADDRESS_COUNT; i++) {
void __iomem *p = ioremap(addresses[i], 0x2000);
if (!p)
continue;
#if DEBUG_DETECT
printk( " %lx(%lx),", addresses[i], bios_base );
#endif
for (j = 0; !bios_base && j < SIGNATURE_COUNT; j++) {
if (isa_check_signature(addresses[i] + signatures[j].sig_offset,
for (j = 0; j < SIGNATURE_COUNT; j++) {
if (check_signature(p + signatures[j].sig_offset,
signatures[j].signature,
signatures[j].sig_length )) {
bios_major = signatures[j].major_bios_version;
......@@ -689,10 +693,14 @@ static int fdomain_isa_detect( int *irq, int *iobase )
PCI_bus = (signatures[j].flag == 1);
Quantum = (signatures[j].flag > 1) ? signatures[j].flag : 0;
bios_base = addresses[i];
bios_mem = p;
goto found;
}
}
iounmap(p);
}
found:
if (bios_major == 2) {
/* The TMC-1660/TMC-1680 has a RAM area just after the BIOS ROM.
Assuming the ROM is enabled (otherwise we wouldn't have been
......@@ -705,13 +713,13 @@ static int fdomain_isa_detect( int *irq, int *iobase )
switch (Quantum) {
case 2: /* ISA_200S */
case 3: /* ISA_250MG */
base = isa_readb(bios_base + 0x1fa2) + (isa_readb(bios_base + 0x1fa3) << 8);
base = readb(bios_mem + 0x1fa2) + (readb(bios_mem + 0x1fa3) << 8);
break;
case 4: /* ISA_200S (another one) */
base = isa_readb(bios_base + 0x1fa3) + (isa_readb(bios_base + 0x1fa4) << 8);
base = readb(bios_mem + 0x1fa3) + (readb(bios_mem + 0x1fa4) << 8);
break;
default:
base = isa_readb(bios_base + 0x1fcc) + (isa_readb(bios_base + 0x1fcd) << 8);
base = readb(bios_mem + 0x1fcc) + (readb(bios_mem + 0x1fcd) << 8);
break;
}
......@@ -1611,26 +1619,26 @@ static int fdomain_16x0_biosparam(struct scsi_device *sdev,
case 2: /* ISA_200S */
/* The value of 25 has never been verified.
It should probably be 15. */
offset = bios_base + 0x1f33 + drive * 25;
offset = 0x1f33 + drive * 25;
break;
case 3: /* ISA_250MG */
offset = bios_base + 0x1f36 + drive * 15;
offset = 0x1f36 + drive * 15;
break;
case 4: /* ISA_200S (another one) */
offset = bios_base + 0x1f34 + drive * 15;
offset = 0x1f34 + drive * 15;
break;
default:
offset = bios_base + 0x1f31 + drive * 25;
offset = 0x1f31 + drive * 25;
break;
}
isa_memcpy_fromio( &i, offset, sizeof( struct drive_info ) );
memcpy_fromio( &i, bios_mem + offset, sizeof( struct drive_info ) );
info_array[0] = i.heads;
info_array[1] = i.sectors;
info_array[2] = i.cylinders;
} else if (bios_major == 3
&& bios_minor >= 0
&& bios_minor < 4) { /* 3.0 and 3.2 BIOS */
memcpy_fromio( &i, bios_base + 0x1f71 + drive * 10,
memcpy_fromio( &i, bios_mem + 0x1f71 + drive * 10,
sizeof( struct drive_info ) );
info_array[0] = i.heads + 1;
info_array[1] = i.sectors;
......
......@@ -454,12 +454,18 @@ int __init seagate_st0x_detect (Scsi_Host_Template * tpnt)
* space for the on-board RAM instead.
*/
for (i = 0; i < (sizeof (seagate_bases) / sizeof (unsigned int)); ++i)
for (j = 0; !base_address && j < NUM_SIGNATURES; ++j)
if (isa_check_signature(seagate_bases[i] + signatures[j].offset, signatures[j].signature, signatures[j].length)) {
for (i = 0; i < (sizeof (seagate_bases) / sizeof (unsigned int)); ++i) {
void __iomem *p = ioremap(seagate_base[i], 0x2000);
if (!p)
continue;
for (j = 0; j < NUM_SIGNATURES; ++j)
if (check_signature(p + signatures[j].offset, signatures[j].signature, signatures[j].length)) {
base_address = seagate_bases[i];
controller_type = signatures[j].type;
break;
}
iounmap(p);
}
#endif /* OVERRIDE */
}
/* (! controller_type) */
......
......@@ -211,13 +211,17 @@ int __init t128_detect(Scsi_Host_Template * tpnt){
base = overrides[current_override].address;
else
for (; !base && (current_base < NO_BASES); ++current_base) {
void __iomem *p;
#if (TDEBUG & TDEBUG_INIT)
printk("scsi-t128 : probing address %08x\n", bases[current_base].address);
#endif
if (bases[current_base].noauto)
continue;
p = ioremap(bases[current_base].address, 0x2000);
if (!p)
continue;
for (sig = 0; sig < NO_SIGNATURES; ++sig)
if (!bases[current_base].noauto &&
isa_check_signature(bases[current_base].address +
signatures[sig].offset,
if (check_signature(p + signatures[sig].offset,
signatures[sig].string,
strlen(signatures[sig].string))) {
base = bases[current_base].address;
......@@ -226,6 +230,7 @@ int __init t128_detect(Scsi_Host_Template * tpnt){
#endif
break;
}
iounmap(p);
}
#if defined(TDEBUG) && (TDEBUG & TDEBUG_INIT)
......
......@@ -631,16 +631,6 @@ isa_memcpy_toio(unsigned long offset, const void *src, long n)
iounmap(addr);
}
static inline int
isa_check_signature(unsigned long offset, const unsigned char *sig, long len)
{
void __iomem *addr = ioremap(offset, len);
int ret = check_signature(addr, sig, len);
iounmap(addr);
return ret;
}
/*
* The Alpha Jensen hardware for some rather strange reason puts
* the RTC clock at 0x170 instead of 0x70. Probably due to some
......
......@@ -176,7 +176,7 @@ extern void _memset_io(void __iomem *, int, size_t);
eth_copy_and_sum((s),__mem_pci(c),(l),(b))
static inline int
check_signature(unsigned long io_addr, const unsigned char *signature,
check_signature(void __iomem *io_addr, const unsigned char *signature,
int length)
{
int retval = 0;
......@@ -226,23 +226,6 @@ check_signature(unsigned long io_addr, const unsigned char *signature,
#define isa_eth_io_copy_and_sum(a,b,c,d) \
eth_copy_and_sum((a),__mem_isa(b),(c),(d))
static inline int
isa_check_signature(unsigned long io_addr, const unsigned char *signature,
int length)
{
int retval = 0;
do {
if (isa_readb(io_addr) != *signature)
goto out;
io_addr++;
signature++;
length--;
} while (length);
retval = 1;
out:
return retval;
}
#else /* __mem_isa */
#define isa_readb(addr) (__readwrite_bug("isa_readb"),0)
......@@ -258,8 +241,6 @@ isa_check_signature(unsigned long io_addr, const unsigned char *signature,
#define isa_eth_io_copy_and_sum(a,b,c,d) \
__readwrite_bug("isa_eth_io_copy_and_sum")
#define isa_check_signature(io,sig,len) (0)
#endif /* __mem_isa */
/*
......
......@@ -248,36 +248,6 @@ static inline int check_signature(volatile void __iomem * io_addr,
return retval;
}
/**
* isa_check_signature - find BIOS signatures
* @io_addr: mmio address to check
* @signature: signature block
* @length: length of signature
*
* Perform a signature comparison with the ISA mmio address io_addr.
* Returns 1 on a match.
*
* This function is deprecated. New drivers should use ioremap and
* check_signature.
*/
static inline int isa_check_signature(unsigned long io_addr,
const unsigned char *signature, int length)
{
int retval = 0;
do {
if (isa_readb(io_addr) != *signature)
goto out;
io_addr++;
signature++;
length--;
} while (length);
retval = 1;
out:
return retval;
}
/*
* Cache management
*
......
......@@ -167,7 +167,7 @@ static inline void _writel(unsigned long l, unsigned long addr)
#define flush_write_buffers() do { } while (0) /* M32R_FIXME */
/**
* isa_check_signature - find BIOS signatures
* check_signature - find BIOS signatures
* @io_addr: mmio address to check
* @signature: signature block
* @length: length of signature
......@@ -179,14 +179,14 @@ static inline void _writel(unsigned long l, unsigned long addr)
* check_signature.
*/
static inline int isa_check_signature(unsigned long io_addr,
static inline int check_signature(void __iomem *io_addr,
const unsigned char *signature, int length)
{
int retval = 0;
#if 0
printk("isa_check_signature\n");
printk("check_signature\n");
do {
if (isa_readb(io_addr) != *signature)
if (readb(io_addr) != *signature)
goto out;
io_addr++;
signature++;
......
......@@ -388,20 +388,6 @@ static inline int check_signature(unsigned long io_addr,
return retval;
}
/*
* isa_check_signature - find BIOS signatures
* @io_addr: mmio address to check
* @signature: signature block
* @length: length of signature
*
* Perform a signature comparison with the ISA mmio address io_addr.
* Returns 1 on a match.
*
* This function is deprecated. New drivers should use ioremap and
* check_signature.
*/
#define isa_check_signature(io, s, l) check_signature(i,s,l)
static inline void __outb(unsigned char val, unsigned long port)
{
port = __swizzle_addr_b(port);
......
......@@ -452,13 +452,6 @@ static inline int check_signature(volatile void __iomem * io_addr,
return retval;
}
/* Make some pcmcia drivers happy */
static inline int isa_check_signature(unsigned long io_addr,
const unsigned char *signature, int length)
{
return 0;
}
/*
* Here comes the ppc implementation of the IOMAP
* interfaces.
......
......@@ -320,38 +320,6 @@ static inline int check_signature(void __iomem *io_addr,
return retval;
}
#ifndef __i386__
/**
* isa_check_signature - find BIOS signatures
* @io_addr: mmio address to check
* @signature: signature block
* @length: length of signature
*
* Perform a signature comparison with the ISA mmio address io_addr.
* Returns 1 on a match.
*
* This function is deprecated. New drivers should use ioremap and
* check_signature.
*/
static inline int isa_check_signature(unsigned long io_addr,
const unsigned char *signature, int length)
{
int retval = 0;
do {
if (isa_readb(io_addr) != *signature)
goto out;
io_addr++;
signature++;
length--;
} while (length);
retval = 1;
out:
return retval;
}
#endif
/* Nothing to do */
#define dma_cache_inv(_start,_size) do { } while (0)
......
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