Changeset b94334f in mainline
- Timestamp:
- 2009-08-22T14:24:03Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a99cf073
- Parents:
- 0e6dce8
- Location:
- uspace/srv/bd/ata_bd
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/ata_bd/ata_bd.c
r0e6dce8 rb94334f 261 261 static int disk_init(disk_t *d, int disk_id) 262 262 { 263 uint16_t buf[256];263 identify_data_t idata; 264 264 uint8_t model[40]; 265 265 uint16_t w; … … 269 269 int i; 270 270 271 rc = drive_identify(disk_id, buf);271 rc = drive_identify(disk_id, &idata); 272 272 if (rc != EOK) { 273 273 d->present = false; … … 275 275 } 276 276 277 d->cylinders = buf[1];278 d->heads = buf[3];279 d->sectors = buf[6];277 d->cylinders = idata.cylinders; 278 d->heads = idata.heads; 279 d->sectors = idata.sectors; 280 280 281 281 d->blocks = d->cylinders * d->heads * d->sectors; … … 285 285 */ 286 286 for (i = 0; i < 20; i++) { 287 w = buf[27 +i];287 w = idata.model_name[i]; 288 288 model[2 * i] = w >> 8; 289 289 model[2 * i + 1] = w & 0x00ff; -
uspace/srv/bd/ata_bd/ata_bd.h
r0e6dce8 rb94334f 143 143 }; 144 144 145 /** Data returned from @c identify command. */ 146 typedef struct { 147 uint16_t gen_conf; 148 uint16_t cylinders; 149 uint16_t _res2; 150 uint16_t heads; 151 uint16_t _vs4; 152 uint16_t _vs5; 153 uint16_t sectors; 154 uint16_t _vs7; 155 uint16_t _vs8; 156 uint16_t _vs9; 157 uint16_t serial_number[10]; 158 uint16_t _vs20; 159 uint16_t _vs21; 160 uint16_t vs_bytes; 161 uint16_t firmware_rev[4]; 162 uint16_t model_name[20]; 163 uint16_t max_rw_multiple; 164 uint16_t _res48; 165 uint16_t caps; 166 uint16_t _res50; 167 uint16_t pio_timing; 168 uint16_t dma_timing; 169 uint16_t validity; 170 uint16_t cur_cyl; 171 uint16_t cur_heads; 172 uint16_t cur_sectors; 173 uint16_t cur_capacity0; 174 uint16_t cur_capacity1; 175 uint16_t mss; 176 uint16_t total_lba_sec0; 177 uint16_t total_lba_sec1; 178 uint16_t sw_dma; 179 uint16_t mw_dma; 180 uint16_t pio_modes; 181 uint16_t min_mw_dma_cycle; 182 uint16_t rec_mw_dma_cycle; 183 uint16_t min_raw_pio_cycle; 184 uint16_t min_iordy_pio_cycle; 185 uint16_t _res69; 186 uint16_t _res70; 187 uint16_t _res71[1 + 127 - 71]; 188 uint16_t _vs128[1 + 159 - 128]; 189 uint16_t _res160[1 + 255 - 160]; 190 } identify_data_t; 191 145 192 typedef struct { 146 193 bool present;
Note:
See TracChangeset
for help on using the changeset viewer.