Changeset 211 for trunk/src/os2ahci/ata.c
- Timestamp:
- Jul 24, 2023, 5:51:46 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/os2ahci/ata.c
r209 r211 4 4 * Copyright (c) 2011 thi.guten Software Development 5 5 * Copyright (c) 2011 Mensys B.V. 6 * Copyright (c) 2013-202 1David Azarewicz <david@88watts.net>6 * Copyright (c) 2013-2023 David Azarewicz <david@88watts.net> 7 7 * 8 8 * Authors: Christian Mueller, Markus Thielen … … 121 121 if (ata_cmd.lba_l & 0xf0000000UL) 122 122 { 123 dprintf(0, "error: LBA-28 address %d has more than 28 bits\n", ata_cmd.lba_l);123 dprintf(0, DBG_PREFIX": error: LBA-28 address %d has more than 28 bits\n", ata_cmd.lba_l); 124 124 return(ATA_CMD_INVALID_PARM); 125 125 } … … 172 172 173 173 default: 174 dprintf(0, "error: v_ata_cmd()called with invalid parameter type (%d)\n", (int) ap);174 dprintf(0, DBG_PREFIX": error: called with invalid parameter type (%d)\n", (int) ap); 175 175 return(ATA_CMD_INVALID_PARM); 176 176 } … … 255 255 if (sg_size) 256 256 { 257 dprintf(0, __func__": unaligned SG element\n");257 dprintf(0, DBG_PREFIX": unaligned SG element\n"); 258 258 return -1; 259 259 } 260 dprintf(0, __func__": too many S/G elements\n");260 dprintf(0, DBG_PREFIX": too many S/G elements\n"); 261 261 return(i - 1); 262 262 } 263 263 if ((sg_addr & 1) || (chunk & 1)) 264 264 { 265 DPRINTF(0, DBG_PREFIX": warning: ata_cmd()called with unaligned S/G element(s)\n");265 DPRINTF(0, DBG_PREFIX": warning: called with unaligned S/G element(s)\n"); 266 266 return(ATA_CMD_UNALIGNED_ADDR); 267 267 } … … 278 278 279 279 #if DEBUG & DBG_DETAILED 280 dprintf(0, "ATA command for %d.%d.%d, slot %d:\n", ad_no(ai), p, d, slot);280 dprintf(0, DBG_PREFIX": ATA command for %d.%d.%d, slot %d:\n", ad_no(ai), p, d, slot); 281 281 dHexDump(0,cmd_hdr, offsetof(AHCI_CMD_HDR, reserved), "cmd_hdr: "); 282 282 dHexDump(0,&ata_cmd, sizeof(ata_cmd), "ata_cmd: "); … … 549 549 { 550 550 /* more than 32 bits for number of sectors */ 551 dprintf(0, "warning: limiting disk %d.%d.%d to 2TB\n",551 dprintf(0, DBG_PREFIX": warning: limiting disk %d.%d.%d to 2TB\n", 552 552 iorb_unit_adapter(pIorb), iorb_unit_port(pIorb), 553 553 iorb_unit_device(pIorb)); … … 651 651 int rc; 652 652 653 if ( ullLba >= (1UL << 28) || count > 256 || add_workspace(pIorb)->is_ncq)653 if (add_workspace(pIorb)->is_ncq || ullLba >= (1 << 28) || count > 256 || (ullLba+count) >= (1 << 28)) 654 654 { 655 655 /* need LBA48 for this command */
Note:
See TracChangeset
for help on using the changeset viewer.