diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/libata-core.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index f3c115b55681..1514cb5e35f7 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -252,6 +252,29 @@ static unsigned int ata_pack_xfermask(unsigned int pio_mask, | |||
252 | ((udma_mask << ATA_SHIFT_UDMA) & ATA_MASK_UDMA); | 252 | ((udma_mask << ATA_SHIFT_UDMA) & ATA_MASK_UDMA); |
253 | } | 253 | } |
254 | 254 | ||
255 | /** | ||
256 | * ata_unpack_xfermask - Unpack xfer_mask into pio, mwdma and udma masks | ||
257 | * @xfer_mask: xfer_mask to unpack | ||
258 | * @pio_mask: resulting pio_mask | ||
259 | * @mwdma_mask: resulting mwdma_mask | ||
260 | * @udma_mask: resulting udma_mask | ||
261 | * | ||
262 | * Unpack @xfer_mask into @pio_mask, @mwdma_mask and @udma_mask. | ||
263 | * Any NULL distination masks will be ignored. | ||
264 | */ | ||
265 | static void ata_unpack_xfermask(unsigned int xfer_mask, | ||
266 | unsigned int *pio_mask, | ||
267 | unsigned int *mwdma_mask, | ||
268 | unsigned int *udma_mask) | ||
269 | { | ||
270 | if (pio_mask) | ||
271 | *pio_mask = (xfer_mask & ATA_MASK_PIO) >> ATA_SHIFT_PIO; | ||
272 | if (mwdma_mask) | ||
273 | *mwdma_mask = (xfer_mask & ATA_MASK_MWDMA) >> ATA_SHIFT_MWDMA; | ||
274 | if (udma_mask) | ||
275 | *udma_mask = (xfer_mask & ATA_MASK_UDMA) >> ATA_SHIFT_UDMA; | ||
276 | } | ||
277 | |||
255 | static const struct ata_xfer_ent { | 278 | static const struct ata_xfer_ent { |
256 | unsigned int shift, bits; | 279 | unsigned int shift, bits; |
257 | u8 base; | 280 | u8 base; |