Lines Matching defs:pba

117 #define PBA_LO(pba) ((pba & 0xF) << 5)
118 #define PBA_HI(pba) (pba >> 3)
119 #define PBA_ZONE(pba) (pba >> 11)
527 static int alauda_get_redu_data(struct us_data *us, u16 pba, unsigned char *data)
532 PBA_HI(pba), PBA_ZONE(pba), 0, PBA_LO(pba), 0, 0, MEDIA_PORT(us)
563 * Produces lba <--> pba mappings
699 static int alauda_erase_block(struct us_data *us, u16 pba)
703 ALAUDA_BULK_CMD, ALAUDA_BULK_ERASE_BLOCK, PBA_HI(pba),
704 PBA_ZONE(pba), 0, PBA_LO(pba), 0x02, 0, MEDIA_PORT(us)
708 usb_stor_dbg(us, "Erasing PBA %d\n", pba);
728 static int alauda_read_block_raw(struct us_data *us, u16 pba,
733 ALAUDA_BULK_CMD, ALAUDA_BULK_READ_BLOCK, PBA_HI(pba),
734 PBA_ZONE(pba), 0, PBA_LO(pba) + page, pages, 0, MEDIA_PORT(us)
737 usb_stor_dbg(us, "pba %d page %d count %d\n", pba, page, pages);
754 static int alauda_read_block(struct us_data *us, u16 pba,
760 rc = alauda_read_block_raw(us, pba, page, pages, data);
779 static int alauda_write_block(struct us_data *us, u16 pba, unsigned char *data)
784 ALAUDA_BULK_CMD, ALAUDA_BULK_WRITE_BLOCK, PBA_HI(pba),
785 PBA_ZONE(pba), 0, PBA_LO(pba), 32, 0, MEDIA_PORT(us)
788 usb_stor_dbg(us, "pba %d\n", pba);
811 u16 pba, lbap, new_pba;
825 pba = MEDIA_INFO(us).lba_to_pba[zone][lba_offset];
826 if (pba == 1) {
832 "alauda_write_lba: avoid writing to pba 1\n");
844 if (pba != UNDEF) {
845 result = alauda_read_block_raw(us, pba, 0,
863 usb_stor_dbg(us, "Warning: bad ecc in page %d- of pba %d\n",
864 i, pba);
869 usb_stor_dbg(us, "Warning: bad ecc in page %d+ of pba %d\n",
870 i, pba);
899 if (pba != UNDEF) {
900 unsigned int pba_offset = pba - (zone * zonesize);
901 result = alauda_erase_block(us, pba);
953 u16 pba;
969 pba = MEDIA_INFO(us).lba_to_pba[zone][lba_offset];
971 if (pba == UNDEF) { /* this lba was never written */
985 pages, pba, lba, page);
987 result = alauda_read_block(us, pba, page, pages, buffer);