|
@@ -723,7 +723,7 @@ sddr09_read_data(struct us_data *us,
|
|
len = min(sectors, (unsigned int) info->blocksize) * info->pagesize;
|
|
len = min(sectors, (unsigned int) info->blocksize) * info->pagesize;
|
|
buffer = kmalloc(len, GFP_NOIO);
|
|
buffer = kmalloc(len, GFP_NOIO);
|
|
if (buffer == NULL) {
|
|
if (buffer == NULL) {
|
|
- printk("sddr09_read_data: Out of memory\n");
|
|
|
|
|
|
+ printk(KERN_WARNING "sddr09_read_data: Out of memory\n");
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -838,7 +838,8 @@ sddr09_write_lba(struct us_data *us, unsigned int lba,
|
|
if (pba == UNDEF) {
|
|
if (pba == UNDEF) {
|
|
pba = sddr09_find_unused_pba(info, lba);
|
|
pba = sddr09_find_unused_pba(info, lba);
|
|
if (!pba) {
|
|
if (!pba) {
|
|
- printk("sddr09_write_lba: Out of unused blocks\n");
|
|
|
|
|
|
+ printk(KERN_WARNING
|
|
|
|
+ "sddr09_write_lba: Out of unused blocks\n");
|
|
return -ENOSPC;
|
|
return -ENOSPC;
|
|
}
|
|
}
|
|
info->pba_to_lba[pba] = lba;
|
|
info->pba_to_lba[pba] = lba;
|
|
@@ -849,7 +850,7 @@ sddr09_write_lba(struct us_data *us, unsigned int lba,
|
|
if (pba == 1) {
|
|
if (pba == 1) {
|
|
/* Maybe it is impossible to write to PBA 1.
|
|
/* Maybe it is impossible to write to PBA 1.
|
|
Fake success, but don't do anything. */
|
|
Fake success, but don't do anything. */
|
|
- printk("sddr09: avoid writing to pba 1\n");
|
|
|
|
|
|
+ printk(KERN_WARNING "sddr09: avoid writing to pba 1\n");
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -954,7 +955,7 @@ sddr09_write_data(struct us_data *us,
|
|
blocklen = (pagelen << info->blockshift);
|
|
blocklen = (pagelen << info->blockshift);
|
|
blockbuffer = kmalloc(blocklen, GFP_NOIO);
|
|
blockbuffer = kmalloc(blocklen, GFP_NOIO);
|
|
if (!blockbuffer) {
|
|
if (!blockbuffer) {
|
|
- printk("sddr09_write_data: Out of memory\n");
|
|
|
|
|
|
+ printk(KERN_WARNING "sddr09_write_data: Out of memory\n");
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -965,7 +966,7 @@ sddr09_write_data(struct us_data *us,
|
|
len = min(sectors, (unsigned int) info->blocksize) * info->pagesize;
|
|
len = min(sectors, (unsigned int) info->blocksize) * info->pagesize;
|
|
buffer = kmalloc(len, GFP_NOIO);
|
|
buffer = kmalloc(len, GFP_NOIO);
|
|
if (buffer == NULL) {
|
|
if (buffer == NULL) {
|
|
- printk("sddr09_write_data: Out of memory\n");
|
|
|
|
|
|
+ printk(KERN_WARNING "sddr09_write_data: Out of memory\n");
|
|
kfree(blockbuffer);
|
|
kfree(blockbuffer);
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
}
|
|
}
|
|
@@ -1112,7 +1113,7 @@ sddr09_get_cardinfo(struct us_data *us, unsigned char flags) {
|
|
|
|
|
|
if (result) {
|
|
if (result) {
|
|
US_DEBUGP("Result of read_deviceID is %d\n", result);
|
|
US_DEBUGP("Result of read_deviceID is %d\n", result);
|
|
- printk("sddr09: could not read card info\n");
|
|
|
|
|
|
+ printk(KERN_WARNING "sddr09: could not read card info\n");
|
|
return NULL;
|
|
return NULL;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1153,7 +1154,7 @@ sddr09_get_cardinfo(struct us_data *us, unsigned char flags) {
|
|
sprintf(blurbtxt + strlen(blurbtxt),
|
|
sprintf(blurbtxt + strlen(blurbtxt),
|
|
", WP");
|
|
", WP");
|
|
|
|
|
|
- printk("%s\n", blurbtxt);
|
|
|
|
|
|
+ printk(KERN_WARNING "%s\n", blurbtxt);
|
|
|
|
|
|
return cardinfo;
|
|
return cardinfo;
|
|
}
|
|
}
|
|
@@ -1184,7 +1185,7 @@ sddr09_read_map(struct us_data *us) {
|
|
alloc_len = (alloc_blocks << CONTROL_SHIFT);
|
|
alloc_len = (alloc_blocks << CONTROL_SHIFT);
|
|
buffer = kmalloc(alloc_len, GFP_NOIO);
|
|
buffer = kmalloc(alloc_len, GFP_NOIO);
|
|
if (buffer == NULL) {
|
|
if (buffer == NULL) {
|
|
- printk("sddr09_read_map: out of memory\n");
|
|
|
|
|
|
+ printk(KERN_WARNING "sddr09_read_map: out of memory\n");
|
|
result = -1;
|
|
result = -1;
|
|
goto done;
|
|
goto done;
|
|
}
|
|
}
|
|
@@ -1198,7 +1199,7 @@ sddr09_read_map(struct us_data *us) {
|
|
info->pba_to_lba = kmalloc(numblocks*sizeof(int), GFP_NOIO);
|
|
info->pba_to_lba = kmalloc(numblocks*sizeof(int), GFP_NOIO);
|
|
|
|
|
|
if (info->lba_to_pba == NULL || info->pba_to_lba == NULL) {
|
|
if (info->lba_to_pba == NULL || info->pba_to_lba == NULL) {
|
|
- printk("sddr09_read_map: out of memory\n");
|
|
|
|
|
|
+ printk(KERN_WARNING "sddr09_read_map: out of memory\n");
|
|
result = -1;
|
|
result = -1;
|
|
goto done;
|
|
goto done;
|
|
}
|
|
}
|
|
@@ -1238,7 +1239,8 @@ sddr09_read_map(struct us_data *us) {
|
|
if (ptr[j] != 0)
|
|
if (ptr[j] != 0)
|
|
goto nonz;
|
|
goto nonz;
|
|
info->pba_to_lba[i] = UNUSABLE;
|
|
info->pba_to_lba[i] = UNUSABLE;
|
|
- printk("sddr09: PBA %d has no logical mapping\n", i);
|
|
|
|
|
|
+ printk(KERN_WARNING "sddr09: PBA %d has no logical mapping\n",
|
|
|
|
+ i);
|
|
continue;
|
|
continue;
|
|
|
|
|
|
nonz:
|
|
nonz:
|
|
@@ -1251,7 +1253,8 @@ sddr09_read_map(struct us_data *us) {
|
|
nonff:
|
|
nonff:
|
|
/* normal PBAs start with six FFs */
|
|
/* normal PBAs start with six FFs */
|
|
if (j < 6) {
|
|
if (j < 6) {
|
|
- printk("sddr09: PBA %d has no logical mapping: "
|
|
|
|
|
|
+ printk(KERN_WARNING
|
|
|
|
+ "sddr09: PBA %d has no logical mapping: "
|
|
"reserved area = %02X%02X%02X%02X "
|
|
"reserved area = %02X%02X%02X%02X "
|
|
"data status %02X block status %02X\n",
|
|
"data status %02X block status %02X\n",
|
|
i, ptr[0], ptr[1], ptr[2], ptr[3],
|
|
i, ptr[0], ptr[1], ptr[2], ptr[3],
|
|
@@ -1261,7 +1264,8 @@ sddr09_read_map(struct us_data *us) {
|
|
}
|
|
}
|
|
|
|
|
|
if ((ptr[6] >> 4) != 0x01) {
|
|
if ((ptr[6] >> 4) != 0x01) {
|
|
- printk("sddr09: PBA %d has invalid address field "
|
|
|
|
|
|
+ printk(KERN_WARNING
|
|
|
|
+ "sddr09: PBA %d has invalid address field "
|
|
"%02X%02X/%02X%02X\n",
|
|
"%02X%02X/%02X%02X\n",
|
|
i, ptr[6], ptr[7], ptr[11], ptr[12]);
|
|
i, ptr[6], ptr[7], ptr[11], ptr[12]);
|
|
info->pba_to_lba[i] = UNUSABLE;
|
|
info->pba_to_lba[i] = UNUSABLE;
|
|
@@ -1270,7 +1274,8 @@ sddr09_read_map(struct us_data *us) {
|
|
|
|
|
|
/* check even parity */
|
|
/* check even parity */
|
|
if (parity[ptr[6] ^ ptr[7]]) {
|
|
if (parity[ptr[6] ^ ptr[7]]) {
|
|
- printk("sddr09: Bad parity in LBA for block %d"
|
|
|
|
|
|
+ printk(KERN_WARNING
|
|
|
|
+ "sddr09: Bad parity in LBA for block %d"
|
|
" (%02X %02X)\n", i, ptr[6], ptr[7]);
|
|
" (%02X %02X)\n", i, ptr[6], ptr[7]);
|
|
info->pba_to_lba[i] = UNUSABLE;
|
|
info->pba_to_lba[i] = UNUSABLE;
|
|
continue;
|
|
continue;
|
|
@@ -1289,7 +1294,8 @@ sddr09_read_map(struct us_data *us) {
|
|
*/
|
|
*/
|
|
|
|
|
|
if (lba >= 1000) {
|
|
if (lba >= 1000) {
|
|
- printk("sddr09: Bad low LBA %d for block %d\n",
|
|
|
|
|
|
+ printk(KERN_WARNING
|
|
|
|
+ "sddr09: Bad low LBA %d for block %d\n",
|
|
lba, i);
|
|
lba, i);
|
|
goto possibly_erase;
|
|
goto possibly_erase;
|
|
}
|
|
}
|
|
@@ -1297,7 +1303,8 @@ sddr09_read_map(struct us_data *us) {
|
|
lba += 1000*(i/0x400);
|
|
lba += 1000*(i/0x400);
|
|
|
|
|
|
if (info->lba_to_pba[lba] != UNDEF) {
|
|
if (info->lba_to_pba[lba] != UNDEF) {
|
|
- printk("sddr09: LBA %d seen for PBA %d and %d\n",
|
|
|
|
|
|
+ printk(KERN_WARNING
|
|
|
|
+ "sddr09: LBA %d seen for PBA %d and %d\n",
|
|
lba, info->lba_to_pba[lba], i);
|
|
lba, info->lba_to_pba[lba], i);
|
|
goto possibly_erase;
|
|
goto possibly_erase;
|
|
}
|
|
}
|