Commit 355d8ae5 authored by Roger Tseng's avatar Roger Tseng Committed by Greg Kroah-Hartman

staging: rts5139: fixed issues when config to built-in object

Fixed two issues when CONFIG_RTS5139=y :

  - Makefile doesn't take $(CONFIG_RTS5139). It always uses obj-m and built as
    a loadable module.
  - Rename some symbols with prefix 'rts51x_' to prevent symbol name collisions
    with drivers/staging/rts_pstor when both are configured to be built-in
    objects.

  drivers/staging/rts5139/built-in.o: In function `xd_cleanup_work':
  (.text+0x1435d): multiple definition of `xd_cleanup_work'
  drivers/staging/rts_pstor/built-in.o:(.text+0x2b96a): first defined here
  drivers/staging/rts5139/built-in.o: In function `release_xd_card':
  (.text+0x14393): multiple definition of `release_xd_card'
  drivers/staging/rts_pstor/built-in.o:(.text+0x2c491): first defined here
  drivers/staging/rts5139/built-in.o: In function `set_sense_data':
  (.text+0x1e02): multiple definition of `set_sense_data'
  drivers/staging/rts_pstor/built-in.o:(.text+0xa79f): first defined here
  drivers/staging/rts5139/built-in.o: In function `ms_delay_write':
  ...
Signed-off-by: default avatarRoger Tseng <rogerable@realtek.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9f3059c9
...@@ -25,13 +25,19 @@ ...@@ -25,13 +25,19 @@
# Makefile for the RTS51xx USB Card Reader drivers. # Makefile for the RTS51xx USB Card Reader drivers.
# #
TARGET_MODULE := rts5139 obj-$(CONFIG_RTS5139) := rts5139.o
EXTRA_CFLAGS := -Idrivers/scsi -I$(PWD) ccflags-y := -Idrivers/scsi
obj-m += $(TARGET_MODULE).o rts5139-y := \
rts51x_transport.o \
common-obj := rts51x_transport.o rts51x_scsi.o rts51x_fop.o rts51x_scsi.o \
rts51x_fop.o \
$(TARGET_MODULE)-objs := $(common-obj) rts51x.o rts51x_chip.o rts51x_card.o \ rts51x.o \
xd.o sd.o ms.o sd_cprm.o ms_mg.o rts51x_chip.o \
rts51x_card.o \
xd.o \
sd.o \
ms.o \
sd_cprm.o \
ms_mg.o
This diff is collapsed.
...@@ -231,18 +231,18 @@ ...@@ -231,18 +231,18 @@
(((retval) != STATUS_SUCCESS) || \ (((retval) != STATUS_SUCCESS) || \
(chip->rsp_buf[0] & MS_TRANSFER_ERR)) (chip->rsp_buf[0] & MS_TRANSFER_ERR))
void mspro_polling_format_status(struct rts51x_chip *chip); void rts51x_mspro_polling_format_status(struct rts51x_chip *chip);
void mspro_format_sense(struct rts51x_chip *chip, unsigned int lun); void rts51x_mspro_format_sense(struct rts51x_chip *chip, unsigned int lun);
int reset_ms_card(struct rts51x_chip *chip); int rts51x_reset_ms_card(struct rts51x_chip *chip);
int ms_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector, int rts51x_ms_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector,
u16 sector_cnt); u16 sector_cnt);
int mspro_format(struct scsi_cmnd *srb, struct rts51x_chip *chip, int rts51x_mspro_format(struct scsi_cmnd *srb, struct rts51x_chip *chip,
int short_data_len, int quick_format); int short_data_len, int quick_format);
void ms_free_l2p_tbl(struct rts51x_chip *chip); void rts51x_ms_free_l2p_tbl(struct rts51x_chip *chip);
void ms_cleanup_work(struct rts51x_chip *chip); void rts51x_ms_cleanup_work(struct rts51x_chip *chip);
int release_ms_card(struct rts51x_chip *chip); int rts51x_release_ms_card(struct rts51x_chip *chip);
int ms_delay_write(struct rts51x_chip *chip); int rts51x_ms_delay_write(struct rts51x_chip *chip);
#ifdef SUPPORT_MAGIC_GATE #ifdef SUPPORT_MAGIC_GATE
......
This diff is collapsed.
...@@ -30,12 +30,12 @@ ...@@ -30,12 +30,12 @@
#include "rts51x_chip.h" #include "rts51x_chip.h"
#include "ms.h" #include "ms.h"
int mg_set_leaf_id(struct scsi_cmnd *srb, struct rts51x_chip *chip); int rts51x_mg_set_leaf_id(struct scsi_cmnd *srb, struct rts51x_chip *chip);
int mg_get_local_EKB(struct scsi_cmnd *srb, struct rts51x_chip *chip); int rts51x_mg_get_local_EKB(struct scsi_cmnd *srb, struct rts51x_chip *chip);
int mg_chg(struct scsi_cmnd *srb, struct rts51x_chip *chip); int rts51x_mg_chg(struct scsi_cmnd *srb, struct rts51x_chip *chip);
int mg_get_rsp_chg(struct scsi_cmnd *srb, struct rts51x_chip *chip); int rts51x_mg_get_rsp_chg(struct scsi_cmnd *srb, struct rts51x_chip *chip);
int mg_rsp(struct scsi_cmnd *srb, struct rts51x_chip *chip); int rts51x_mg_rsp(struct scsi_cmnd *srb, struct rts51x_chip *chip);
int mg_get_ICV(struct scsi_cmnd *srb, struct rts51x_chip *chip); int rts51x_mg_get_ICV(struct scsi_cmnd *srb, struct rts51x_chip *chip);
int mg_set_ICV(struct scsi_cmnd *srb, struct rts51x_chip *chip); int rts51x_mg_set_ICV(struct scsi_cmnd *srb, struct rts51x_chip *chip);
#endif /* __RTS51X_MS_MG_H */ #endif /* __RTS51X_MS_MG_H */
...@@ -306,7 +306,7 @@ static int rts51x_control_thread(void *__chip) ...@@ -306,7 +306,7 @@ static int rts51x_control_thread(void *__chip)
/* we've got a command, let's do it! */ /* we've got a command, let's do it! */
else { else {
RTS51X_DEBUG(scsi_show_command(chip->srb)); RTS51X_DEBUG(rts51x_scsi_show_command(chip->srb));
rts51x_invoke_transport(chip->srb, chip); rts51x_invoke_transport(chip->srb, chip);
} }
...@@ -397,7 +397,7 @@ static int rts51x_polling_thread(void *__chip) ...@@ -397,7 +397,7 @@ static int rts51x_polling_thread(void *__chip)
} }
#endif #endif
mspro_polling_format_status(chip); rts51x_mspro_polling_format_status(chip);
/* lock the device pointers */ /* lock the device pointers */
mutex_lock(&(chip->usb->dev_mutex)); mutex_lock(&(chip->usb->dev_mutex));
...@@ -478,7 +478,7 @@ static void rts51x_init_options(struct rts51x_chip *chip) ...@@ -478,7 +478,7 @@ static void rts51x_init_options(struct rts51x_chip *chip)
{ {
struct rts51x_option *option = &(chip->option); struct rts51x_option *option = &(chip->option);
option->mspro_formatter_enable = 1; option->rts51x_mspro_formatter_enable = 1;
option->fpga_sd_sdr104_clk = CLK_100; option->fpga_sd_sdr104_clk = CLK_100;
option->fpga_sd_sdr50_clk = CLK_100; option->fpga_sd_sdr50_clk = CLK_100;
...@@ -510,7 +510,7 @@ static void rts51x_init_options(struct rts51x_chip *chip) ...@@ -510,7 +510,7 @@ static void rts51x_init_options(struct rts51x_chip *chip)
option->FT2_fast_mode = 0; option->FT2_fast_mode = 0;
option->pwr_delay = 800; option->pwr_delay = 800;
option->xd_rw_step = 0; option->rts51x_xd_rw_step = 0;
option->D3318_off_delay = 50; option->D3318_off_delay = 50;
option->delink_delay = 100; option->delink_delay = 100;
option->rts5129_D3318_off_enable = 0; option->rts5129_D3318_off_enable = 0;
...@@ -518,7 +518,7 @@ static void rts51x_init_options(struct rts51x_chip *chip) ...@@ -518,7 +518,7 @@ static void rts51x_init_options(struct rts51x_chip *chip)
option->reset_or_rw_fail_set_pad_drive = 1; option->reset_or_rw_fail_set_pad_drive = 1;
option->debounce_num = 2; option->debounce_num = 2;
option->led_toggle_interval = 6; option->led_toggle_interval = 6;
option->xd_rwn_step = 0; option->rts51x_xd_rwn_step = 0;
option->sd_send_status_en = 0; option->sd_send_status_en = 0;
option->sdr50_tx_phase = 0x01; option->sdr50_tx_phase = 0x01;
option->sdr50_rx_phase = 0x05; option->sdr50_rx_phase = 0x05;
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#include "sd.h" #include "sd.h"
#include "ms.h" #include "ms.h"
void do_remaining_work(struct rts51x_chip *chip) void rts51x_do_remaining_work(struct rts51x_chip *chip)
{ {
struct sd_info *sd_card = &(chip->sd_card); struct sd_info *sd_card = &(chip->sd_card);
struct xd_info *xd_card = &(chip->xd_card); struct xd_info *xd_card = &(chip->xd_card);
...@@ -84,27 +84,27 @@ void do_remaining_work(struct rts51x_chip *chip) ...@@ -84,27 +84,27 @@ void do_remaining_work(struct rts51x_chip *chip)
} }
if (sd_card->counter > POLLING_WAIT_CNT) if (sd_card->counter > POLLING_WAIT_CNT)
sd_cleanup_work(chip); rts51x_sd_cleanup_work(chip);
if (xd_card->counter > POLLING_WAIT_CNT) if (xd_card->counter > POLLING_WAIT_CNT)
xd_cleanup_work(chip); rts51x_xd_cleanup_work(chip);
if (ms_card->counter > POLLING_WAIT_CNT) if (ms_card->counter > POLLING_WAIT_CNT)
ms_cleanup_work(chip); rts51x_ms_cleanup_work(chip);
} }
static void do_reset_xd_card(struct rts51x_chip *chip) static void do_rts51x_reset_xd_card(struct rts51x_chip *chip)
{ {
int retval; int retval;
if (chip->card2lun[XD_CARD] >= MAX_ALLOWED_LUN_CNT) if (chip->card2lun[XD_CARD] >= MAX_ALLOWED_LUN_CNT)
return; return;
retval = reset_xd_card(chip); retval = rts51x_reset_xd_card(chip);
if (retval == STATUS_SUCCESS) { if (retval == STATUS_SUCCESS) {
chip->card_ready |= XD_CARD; chip->card_ready |= XD_CARD;
chip->card_fail &= ~XD_CARD; chip->card_fail &= ~XD_CARD;
chip->rw_card[chip->card2lun[XD_CARD]] = xd_rw; chip->rw_card[chip->card2lun[XD_CARD]] = rts51x_xd_rw;
} else { } else {
chip->card_ready &= ~XD_CARD; chip->card_ready &= ~XD_CARD;
chip->card_fail |= XD_CARD; chip->card_fail |= XD_CARD;
...@@ -120,18 +120,18 @@ static void do_reset_xd_card(struct rts51x_chip *chip) ...@@ -120,18 +120,18 @@ static void do_reset_xd_card(struct rts51x_chip *chip)
} }
} }
void do_reset_sd_card(struct rts51x_chip *chip) void rts51x_do_rts51x_reset_sd_card(struct rts51x_chip *chip)
{ {
int retval; int retval;
if (chip->card2lun[SD_CARD] >= MAX_ALLOWED_LUN_CNT) if (chip->card2lun[SD_CARD] >= MAX_ALLOWED_LUN_CNT)
return; return;
retval = reset_sd_card(chip); retval = rts51x_reset_sd_card(chip);
if (retval == STATUS_SUCCESS) { if (retval == STATUS_SUCCESS) {
chip->card_ready |= SD_CARD; chip->card_ready |= SD_CARD;
chip->card_fail &= ~SD_CARD; chip->card_fail &= ~SD_CARD;
chip->rw_card[chip->card2lun[SD_CARD]] = sd_rw; chip->rw_card[chip->card2lun[SD_CARD]] = rts51x_sd_rw;
} else { } else {
chip->card_ready &= ~SD_CARD; chip->card_ready &= ~SD_CARD;
chip->card_fail |= SD_CARD; chip->card_fail |= SD_CARD;
...@@ -147,18 +147,18 @@ void do_reset_sd_card(struct rts51x_chip *chip) ...@@ -147,18 +147,18 @@ void do_reset_sd_card(struct rts51x_chip *chip)
} }
} }
static void do_reset_ms_card(struct rts51x_chip *chip) static void do_rts51x_reset_ms_card(struct rts51x_chip *chip)
{ {
int retval; int retval;
if (chip->card2lun[MS_CARD] >= MAX_ALLOWED_LUN_CNT) if (chip->card2lun[MS_CARD] >= MAX_ALLOWED_LUN_CNT)
return; return;
retval = reset_ms_card(chip); retval = rts51x_reset_ms_card(chip);
if (retval == STATUS_SUCCESS) { if (retval == STATUS_SUCCESS) {
chip->card_ready |= MS_CARD; chip->card_ready |= MS_CARD;
chip->card_fail &= ~MS_CARD; chip->card_fail &= ~MS_CARD;
chip->rw_card[chip->card2lun[MS_CARD]] = ms_rw; chip->rw_card[chip->card2lun[MS_CARD]] = rts51x_ms_rw;
} else { } else {
chip->card_ready &= ~MS_CARD; chip->card_ready &= ~MS_CARD;
chip->card_fail |= MS_CARD; chip->card_fail |= MS_CARD;
...@@ -301,7 +301,7 @@ void rts51x_init_cards(struct rts51x_chip *chip) ...@@ -301,7 +301,7 @@ void rts51x_init_cards(struct rts51x_chip *chip)
chip->card_exist &= ~XD_CARD; chip->card_exist &= ~XD_CARD;
chip->card_ejected = 0; chip->card_ejected = 0;
if (chip->card_ready & XD_CARD) { if (chip->card_ready & XD_CARD) {
release_xd_card(chip); rts51x_release_xd_card(chip);
chip->rw_card[chip->card2lun[XD_CARD]] = NULL; chip->rw_card[chip->card2lun[XD_CARD]] = NULL;
clear_bit(chip->card2lun[XD_CARD], clear_bit(chip->card2lun[XD_CARD],
&(chip->lun_mc)); &(chip->lun_mc));
...@@ -312,7 +312,7 @@ void rts51x_init_cards(struct rts51x_chip *chip) ...@@ -312,7 +312,7 @@ void rts51x_init_cards(struct rts51x_chip *chip)
chip->card_exist &= ~SD_CARD; chip->card_exist &= ~SD_CARD;
chip->card_ejected = 0; chip->card_ejected = 0;
if (chip->card_ready & SD_CARD) { if (chip->card_ready & SD_CARD) {
release_sd_card(chip); rts51x_release_sd_card(chip);
chip->rw_card[chip->card2lun[SD_CARD]] = NULL; chip->rw_card[chip->card2lun[SD_CARD]] = NULL;
clear_bit(chip->card2lun[SD_CARD], clear_bit(chip->card2lun[SD_CARD],
&(chip->lun_mc)); &(chip->lun_mc));
...@@ -323,7 +323,7 @@ void rts51x_init_cards(struct rts51x_chip *chip) ...@@ -323,7 +323,7 @@ void rts51x_init_cards(struct rts51x_chip *chip)
chip->card_exist &= ~MS_CARD; chip->card_exist &= ~MS_CARD;
chip->card_ejected = 0; chip->card_ejected = 0;
if (chip->card_ready & MS_CARD) { if (chip->card_ready & MS_CARD) {
release_ms_card(chip); rts51x_release_ms_card(chip);
chip->rw_card[chip->card2lun[MS_CARD]] = NULL; chip->rw_card[chip->card2lun[MS_CARD]] = NULL;
clear_bit(chip->card2lun[MS_CARD], clear_bit(chip->card2lun[MS_CARD],
&(chip->lun_mc)); &(chip->lun_mc));
...@@ -339,13 +339,13 @@ void rts51x_init_cards(struct rts51x_chip *chip) ...@@ -339,13 +339,13 @@ void rts51x_init_cards(struct rts51x_chip *chip)
if (need_reset & XD_CARD) { if (need_reset & XD_CARD) {
chip->card_exist |= XD_CARD; chip->card_exist |= XD_CARD;
do_reset_xd_card(chip); do_rts51x_reset_xd_card(chip);
} else if (need_reset & SD_CARD) { } else if (need_reset & SD_CARD) {
chip->card_exist |= SD_CARD; chip->card_exist |= SD_CARD;
do_reset_sd_card(chip); rts51x_do_rts51x_reset_sd_card(chip);
} else if (need_reset & MS_CARD) { } else if (need_reset & MS_CARD) {
chip->card_exist |= MS_CARD; chip->card_exist |= MS_CARD;
do_reset_ms_card(chip); do_rts51x_reset_ms_card(chip);
} }
} }
} }
...@@ -353,20 +353,20 @@ void rts51x_init_cards(struct rts51x_chip *chip) ...@@ -353,20 +353,20 @@ void rts51x_init_cards(struct rts51x_chip *chip)
void rts51x_release_cards(struct rts51x_chip *chip) void rts51x_release_cards(struct rts51x_chip *chip)
{ {
if (chip->card_ready & SD_CARD) { if (chip->card_ready & SD_CARD) {
sd_cleanup_work(chip); rts51x_sd_cleanup_work(chip);
release_sd_card(chip); rts51x_release_sd_card(chip);
chip->card_ready &= ~SD_CARD; chip->card_ready &= ~SD_CARD;
} }
if (chip->card_ready & XD_CARD) { if (chip->card_ready & XD_CARD) {
xd_cleanup_work(chip); rts51x_xd_cleanup_work(chip);
release_xd_card(chip); rts51x_release_xd_card(chip);
chip->card_ready &= ~XD_CARD; chip->card_ready &= ~XD_CARD;
} }
if (chip->card_ready & MS_CARD) { if (chip->card_ready & MS_CARD) {
ms_cleanup_work(chip); rts51x_ms_cleanup_work(chip);
release_ms_card(chip); rts51x_release_ms_card(chip);
chip->card_ready &= ~MS_CARD; chip->card_ready &= ~MS_CARD;
} }
} }
...@@ -376,7 +376,7 @@ static inline u8 double_depth(u8 depth) ...@@ -376,7 +376,7 @@ static inline u8 double_depth(u8 depth)
return ((depth > 1) ? (depth - 1) : depth); return ((depth > 1) ? (depth - 1) : depth);
} }
int switch_ssc_clock(struct rts51x_chip *chip, int clk) int rts51x_switch_ssc_clock(struct rts51x_chip *chip, int clk)
{ {
struct sd_info *sd_card = &(chip->sd_card); struct sd_info *sd_card = &(chip->sd_card);
struct ms_info *ms_card = &(chip->ms_card); struct ms_info *ms_card = &(chip->ms_card);
...@@ -513,7 +513,7 @@ int switch_ssc_clock(struct rts51x_chip *chip, int clk) ...@@ -513,7 +513,7 @@ int switch_ssc_clock(struct rts51x_chip *chip, int clk)
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
int switch_normal_clock(struct rts51x_chip *chip, int clk) int rts51x_switch_normal_clock(struct rts51x_chip *chip, int clk)
{ {
int retval; int retval;
u8 sel, div, mcu_cnt; u8 sel, div, mcu_cnt;
...@@ -653,7 +653,7 @@ int switch_normal_clock(struct rts51x_chip *chip, int clk) ...@@ -653,7 +653,7 @@ int switch_normal_clock(struct rts51x_chip *chip, int clk)
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
int card_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 sec_addr, int rts51x_card_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 sec_addr,
u16 sec_cnt) u16 sec_cnt)
{ {
int retval; int retval;
...@@ -688,7 +688,7 @@ int card_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 sec_addr, ...@@ -688,7 +688,7 @@ int card_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 sec_addr,
return retval; return retval;
} }
u8 get_lun_card(struct rts51x_chip *chip, unsigned int lun) u8 rts51x_get_lun_card(struct rts51x_chip *chip, unsigned int lun)
{ {
if ((chip->card_ready & chip->lun2card[lun]) == XD_CARD) if ((chip->card_ready & chip->lun2card[lun]) == XD_CARD)
return (u8) XD_CARD; return (u8) XD_CARD;
...@@ -744,24 +744,24 @@ int rts51x_select_card(struct rts51x_chip *chip, int card) ...@@ -744,24 +744,24 @@ int rts51x_select_card(struct rts51x_chip *chip, int card)
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
void eject_card(struct rts51x_chip *chip, unsigned int lun) void rts51x_eject_card(struct rts51x_chip *chip, unsigned int lun)
{ {
RTS51X_DEBUGP("eject card\n"); RTS51X_DEBUGP("eject card\n");
RTS51X_SET_STAT(chip, STAT_RUN); RTS51X_SET_STAT(chip, STAT_RUN);
do_remaining_work(chip); rts51x_do_remaining_work(chip);
if ((chip->card_ready & chip->lun2card[lun]) == SD_CARD) { if ((chip->card_ready & chip->lun2card[lun]) == SD_CARD) {
release_sd_card(chip); rts51x_release_sd_card(chip);
chip->card_ejected |= SD_CARD; chip->card_ejected |= SD_CARD;
chip->card_ready &= ~SD_CARD; chip->card_ready &= ~SD_CARD;
chip->capacity[lun] = 0; chip->capacity[lun] = 0;
} else if ((chip->card_ready & chip->lun2card[lun]) == XD_CARD) { } else if ((chip->card_ready & chip->lun2card[lun]) == XD_CARD) {
release_xd_card(chip); rts51x_release_xd_card(chip);
chip->card_ejected |= XD_CARD; chip->card_ejected |= XD_CARD;
chip->card_ready &= ~XD_CARD; chip->card_ready &= ~XD_CARD;
chip->capacity[lun] = 0; chip->capacity[lun] = 0;
} else if ((chip->card_ready & chip->lun2card[lun]) == MS_CARD) { } else if ((chip->card_ready & chip->lun2card[lun]) == MS_CARD) {
release_ms_card(chip); rts51x_release_ms_card(chip);
chip->card_ejected |= MS_CARD; chip->card_ejected |= MS_CARD;
chip->card_ready &= ~MS_CARD; chip->card_ready &= ~MS_CARD;
chip->capacity[lun] = 0; chip->capacity[lun] = 0;
...@@ -770,7 +770,7 @@ void eject_card(struct rts51x_chip *chip, unsigned int lun) ...@@ -770,7 +770,7 @@ void eject_card(struct rts51x_chip *chip, unsigned int lun)
XD_INT | MS_INT | SD_INT); XD_INT | MS_INT | SD_INT);
} }
void trans_dma_enable(enum dma_data_direction dir, struct rts51x_chip *chip, void rts51x_trans_dma_enable(enum dma_data_direction dir, struct rts51x_chip *chip,
u32 byte_cnt, u8 pack_size) u32 byte_cnt, u8 pack_size)
{ {
if (pack_size > DMA_1024) if (pack_size > DMA_1024)
...@@ -798,7 +798,7 @@ void trans_dma_enable(enum dma_data_direction dir, struct rts51x_chip *chip, ...@@ -798,7 +798,7 @@ void trans_dma_enable(enum dma_data_direction dir, struct rts51x_chip *chip,
} }
} }
int enable_card_clock(struct rts51x_chip *chip, u8 card) int rts51x_enable_card_clock(struct rts51x_chip *chip, u8 card)
{ {
u8 clk_en = 0; u8 clk_en = 0;
...@@ -814,7 +814,7 @@ int enable_card_clock(struct rts51x_chip *chip, u8 card) ...@@ -814,7 +814,7 @@ int enable_card_clock(struct rts51x_chip *chip, u8 card)
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
int card_power_on(struct rts51x_chip *chip, u8 card) int rts51x_card_power_on(struct rts51x_chip *chip, u8 card)
{ {
u8 mask, val1, val2; u8 mask, val1, val2;
...@@ -863,7 +863,7 @@ int monitor_card_cd(struct rts51x_chip *chip, u8 card) ...@@ -863,7 +863,7 @@ int monitor_card_cd(struct rts51x_chip *chip, u8 card)
return CD_NOT_EXIST; return CD_NOT_EXIST;
} }
int toggle_gpio(struct rts51x_chip *chip, u8 gpio) int rts51x_toggle_gpio(struct rts51x_chip *chip, u8 gpio)
{ {
int retval; int retval;
u8 temp_reg; u8 temp_reg;
...@@ -898,7 +898,7 @@ int toggle_gpio(struct rts51x_chip *chip, u8 gpio) ...@@ -898,7 +898,7 @@ int toggle_gpio(struct rts51x_chip *chip, u8 gpio)
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
int turn_on_led(struct rts51x_chip *chip, u8 gpio) int rts51x_turn_on_led(struct rts51x_chip *chip, u8 gpio)
{ {
int retval; int retval;
u8 gpio_oe[4] = { u8 gpio_oe[4] = {
...@@ -917,7 +917,7 @@ int turn_on_led(struct rts51x_chip *chip, u8 gpio) ...@@ -917,7 +917,7 @@ int turn_on_led(struct rts51x_chip *chip, u8 gpio)
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
int turn_off_led(struct rts51x_chip *chip, u8 gpio) int rts51x_turn_off_led(struct rts51x_chip *chip, u8 gpio)
{ {
int retval; int retval;
u8 gpio_output[4] = { u8 gpio_output[4] = {
......
...@@ -737,24 +737,24 @@ ...@@ -737,24 +737,24 @@
int monitor_card_cd(struct rts51x_chip *chip, u8 card); int monitor_card_cd(struct rts51x_chip *chip, u8 card);
void do_remaining_work(struct rts51x_chip *chip); void rts51x_do_remaining_work(struct rts51x_chip *chip);
void do_reset_sd_card(struct rts51x_chip *chip); void rts51x_do_rts51x_reset_sd_card(struct rts51x_chip *chip);
void rts51x_init_cards(struct rts51x_chip *chip); void rts51x_init_cards(struct rts51x_chip *chip);
void rts51x_release_cards(struct rts51x_chip *chip); void rts51x_release_cards(struct rts51x_chip *chip);
int switch_ssc_clock(struct rts51x_chip *chip, int clk); int rts51x_switch_ssc_clock(struct rts51x_chip *chip, int clk);
int switch_normal_clock(struct rts51x_chip *chip, int clk); int rts51x_switch_normal_clock(struct rts51x_chip *chip, int clk);
int card_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 sec_addr, int rts51x_card_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 sec_addr,
u16 sec_cnt); u16 sec_cnt);
u8 get_lun_card(struct rts51x_chip *chip, unsigned int lun); u8 rts51x_get_lun_card(struct rts51x_chip *chip, unsigned int lun);
int rts51x_select_card(struct rts51x_chip *chip, int card); int rts51x_select_card(struct rts51x_chip *chip, int card);
void eject_card(struct rts51x_chip *chip, unsigned int lun); void rts51x_eject_card(struct rts51x_chip *chip, unsigned int lun);
void trans_dma_enable(enum dma_data_direction dir, struct rts51x_chip *chip, void rts51x_trans_dma_enable(enum dma_data_direction dir, struct rts51x_chip *chip,
u32 byte_cnt, u8 pack_size); u32 byte_cnt, u8 pack_size);
int enable_card_clock(struct rts51x_chip *chip, u8 card); int rts51x_enable_card_clock(struct rts51x_chip *chip, u8 card);
int card_power_on(struct rts51x_chip *chip, u8 card); int rts51x_card_power_on(struct rts51x_chip *chip, u8 card);
int toggle_gpio(struct rts51x_chip *chip, u8 gpio); int rts51x_toggle_gpio(struct rts51x_chip *chip, u8 gpio);
int turn_on_led(struct rts51x_chip *chip, u8 gpio); int rts51x_turn_on_led(struct rts51x_chip *chip, u8 gpio);
int turn_off_led(struct rts51x_chip *chip, u8 gpio); int rts51x_turn_off_led(struct rts51x_chip *chip, u8 gpio);
static inline int check_card_ready(struct rts51x_chip *chip, unsigned int lun) static inline int check_card_ready(struct rts51x_chip *chip, unsigned int lun)
{ {
...@@ -830,9 +830,9 @@ static inline int switch_clock(struct rts51x_chip *chip, int clk) ...@@ -830,9 +830,9 @@ static inline int switch_clock(struct rts51x_chip *chip, int clk)
int retval = 0; int retval = 0;
if (chip->asic_code) if (chip->asic_code)
retval = switch_ssc_clock(chip, clk); retval = rts51x_switch_ssc_clock(chip, clk);
else else
retval = switch_normal_clock(chip, clk); retval = rts51x_switch_normal_clock(chip, clk);
return retval; return retval;
} }
......
...@@ -132,7 +132,7 @@ int rts51x_reset_chip(struct rts51x_chip *chip) ...@@ -132,7 +132,7 @@ int rts51x_reset_chip(struct rts51x_chip *chip)
} }
#endif #endif
if (chip->option.FT2_fast_mode) { if (chip->option.FT2_fast_mode) {
card_power_on(chip, SD_CARD | MS_CARD | XD_CARD); rts51x_card_power_on(chip, SD_CARD | MS_CARD | XD_CARD);
wait_timeout(10); wait_timeout(10);
} }
...@@ -212,8 +212,8 @@ int rts51x_init_chip(struct rts51x_chip *chip) ...@@ -212,8 +212,8 @@ int rts51x_init_chip(struct rts51x_chip *chip)
int rts51x_release_chip(struct rts51x_chip *chip) int rts51x_release_chip(struct rts51x_chip *chip)
{ {
xd_free_l2p_tbl(chip); rts51x_xd_free_l2p_tbl(chip);
ms_free_l2p_tbl(chip); rts51x_ms_free_l2p_tbl(chip);
chip->card_ready = 0; chip->card_ready = 0;
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
...@@ -227,7 +227,7 @@ static inline void rts51x_blink_led(struct rts51x_chip *chip) ...@@ -227,7 +227,7 @@ static inline void rts51x_blink_led(struct rts51x_chip *chip)
chip->led_toggle_counter++; chip->led_toggle_counter++;
} else { } else {
chip->led_toggle_counter = 0; chip->led_toggle_counter = 0;
toggle_gpio(chip, LED_GPIO); rts51x_toggle_gpio(chip, LED_GPIO);
} }
} }
} }
...@@ -325,14 +325,14 @@ void rts51x_polling_func(struct rts51x_chip *chip) ...@@ -325,14 +325,14 @@ void rts51x_polling_func(struct rts51x_chip *chip)
&& (chip->card_exist & && (chip->card_exist &
(SD_CARD | MS_CARD | XD_CARD)) (SD_CARD | MS_CARD | XD_CARD))
&& (!chip->card_ejected)) { && (!chip->card_ejected)) {
turn_on_led(chip, LED_GPIO); rts51x_turn_on_led(chip, LED_GPIO);
} else { } else {
if (chip->rts5179) { if (chip->rts5179) {
rts51x_ep0_write_register(chip, rts51x_ep0_write_register(chip,
CARD_GPIO, CARD_GPIO,
0x03, 0x00); 0x03, 0x00);
} else { } else {
turn_off_led(chip, LED_GPIO); rts51x_turn_off_led(chip, LED_GPIO);
} }
} }
...@@ -353,7 +353,7 @@ void rts51x_polling_func(struct rts51x_chip *chip) ...@@ -353,7 +353,7 @@ void rts51x_polling_func(struct rts51x_chip *chip)
switch (RTS51X_GET_STAT(chip)) { switch (RTS51X_GET_STAT(chip)) {
case STAT_RUN: case STAT_RUN:
rts51x_blink_led(chip); rts51x_blink_led(chip);
do_remaining_work(chip); rts51x_do_remaining_work(chip);
break; break;
case STAT_IDLE: case STAT_IDLE:
...@@ -707,7 +707,7 @@ void rts51x_do_before_power_down(struct rts51x_chip *chip) ...@@ -707,7 +707,7 @@ void rts51x_do_before_power_down(struct rts51x_chip *chip)
if (chip->rts5179) if (chip->rts5179)
rts51x_ep0_write_register(chip, CARD_GPIO, 0x03, 0x00); rts51x_ep0_write_register(chip, CARD_GPIO, 0x03, 0x00);
else else
turn_off_led(chip, LED_GPIO); rts51x_turn_off_led(chip, LED_GPIO);
chip->cur_clk = 0; chip->cur_clk = 0;
chip->card_exist = 0; chip->card_exist = 0;
...@@ -797,7 +797,7 @@ void rts51x_pp_status(struct rts51x_chip *chip, unsigned int lun, u8 *status, ...@@ -797,7 +797,7 @@ void rts51x_pp_status(struct rts51x_chip *chip, unsigned int lun, u8 *status,
{ {
struct sd_info *sd_card = &(chip->sd_card); struct sd_info *sd_card = &(chip->sd_card);
struct ms_info *ms_card = &(chip->ms_card); struct ms_info *ms_card = &(chip->ms_card);
u8 card = get_lun_card(chip, lun); u8 card = rts51x_get_lun_card(chip, lun);
#ifdef SUPPORT_OC #ifdef SUPPORT_OC
u8 oc_now_mask = 0, oc_ever_mask = 0; u8 oc_now_mask = 0, oc_ever_mask = 0;
#endif #endif
...@@ -958,9 +958,9 @@ void rts51x_read_status(struct rts51x_chip *chip, unsigned int lun, ...@@ -958,9 +958,9 @@ void rts51x_read_status(struct rts51x_chip *chip, unsigned int lun,
rts51x_status[12] = 0; rts51x_status[12] = 0;
/* Detailed Type */ /* Detailed Type */
if (get_lun_card(chip, lun) == XD_CARD) { if (rts51x_get_lun_card(chip, lun) == XD_CARD) {
rts51x_status[13] = 0x40; rts51x_status[13] = 0x40;
} else if (get_lun_card(chip, lun) == SD_CARD) { } else if (rts51x_get_lun_card(chip, lun) == SD_CARD) {
struct sd_info *sd_card = &(chip->sd_card); struct sd_info *sd_card = &(chip->sd_card);
rts51x_status[13] = 0x20; rts51x_status[13] = 0x20;
...@@ -976,7 +976,7 @@ void rts51x_read_status(struct rts51x_chip *chip, unsigned int lun, ...@@ -976,7 +976,7 @@ void rts51x_read_status(struct rts51x_chip *chip, unsigned int lun,
if (CHK_MMC_SECTOR_MODE(sd_card)) if (CHK_MMC_SECTOR_MODE(sd_card))
rts51x_status[13] |= 0x04; /* Hi capacity */ rts51x_status[13] |= 0x04; /* Hi capacity */
} }
} else if (get_lun_card(chip, lun) == MS_CARD) { } else if (rts51x_get_lun_card(chip, lun) == MS_CARD) {
struct ms_info *ms_card = &(chip->ms_card); struct ms_info *ms_card = &(chip->ms_card);
if (CHK_MSPRO(ms_card)) { if (CHK_MSPRO(ms_card)) {
......
...@@ -253,7 +253,7 @@ struct sense_data_t { ...@@ -253,7 +253,7 @@ struct sense_data_t {
#define SUPPORT_UHS50_MMC44 0x40 #define SUPPORT_UHS50_MMC44 0x40
struct rts51x_option { struct rts51x_option {
int mspro_formatter_enable; int rts51x_mspro_formatter_enable;
/* card clock expected by user for fpga platform */ /* card clock expected by user for fpga platform */
int fpga_sd_sdr104_clk; int fpga_sd_sdr104_clk;
...@@ -308,7 +308,7 @@ struct rts51x_option { ...@@ -308,7 +308,7 @@ struct rts51x_option {
* add for config delay between 1/4 PMOS and 3/4 PMOS */ * add for config delay between 1/4 PMOS and 3/4 PMOS */
int pwr_delay; int pwr_delay;
int xd_rw_step; /* add to tune xd tRP */ int rts51x_xd_rw_step; /* add to tune xd tRP */
int D3318_off_delay; /* add to tune D3318 off delay time */ int D3318_off_delay; /* add to tune D3318 off delay time */
int delink_delay; /* add to tune delink delay time */ int delink_delay; /* add to tune delink delay time */
/* add for rts5129 to enable/disable D3318 off */ /* add for rts5129 to enable/disable D3318 off */
...@@ -320,7 +320,7 @@ struct rts51x_option { ...@@ -320,7 +320,7 @@ struct rts51x_option {
u8 debounce_num; /* debounce number */ u8 debounce_num; /* debounce number */
u8 led_toggle_interval; /* used to control led toggle speed */ u8 led_toggle_interval; /* used to control led toggle speed */
int xd_rwn_step; int rts51x_xd_rwn_step;
u8 sd_send_status_en; u8 sd_send_status_en;
/* used to store default phase which is /* used to store default phase which is
* used when phase tune all pass. */ * used when phase tune all pass. */
...@@ -337,11 +337,11 @@ struct rts51x_option { ...@@ -337,11 +337,11 @@ struct rts51x_option {
u8 dv18_voltage; /* add to tune dv18 voltage */ u8 dv18_voltage; /* add to tune dv18 voltage */
}; };
#define MS_FORMATTER_ENABLED(chip) ((chip)->option.mspro_formatter_enable) #define MS_FORMATTER_ENABLED(chip) ((chip)->option.rts51x_mspro_formatter_enable)
struct rts51x_chip; struct rts51x_chip;
typedef int (*card_rw_func) (struct scsi_cmnd *srb, struct rts51x_chip *chip, typedef int (*rts51x_card_rw_func) (struct scsi_cmnd *srb, struct rts51x_chip *chip,
u32 sec_addr, u16 sec_cnt); u32 sec_addr, u16 sec_cnt);
/* For MS Card */ /* For MS Card */
...@@ -564,7 +564,7 @@ struct sd_info { ...@@ -564,7 +564,7 @@ struct sd_info {
#define CHK_MS8BIT(ms_card) (((ms_card)->ms_type & MS_8BIT)) #define CHK_MS8BIT(ms_card) (((ms_card)->ms_type & MS_8BIT))
#define CHK_MS4BIT(ms_card) (((ms_card)->ms_type & MS_4BIT)) #define CHK_MS4BIT(ms_card) (((ms_card)->ms_type & MS_4BIT))
struct ms_delay_write_tag { struct rts51x_ms_delay_write_tag {
u16 old_phyblock; u16 old_phyblock;
u16 new_phyblock; u16 new_phyblock;
u16 logblock; u16 logblock;
...@@ -605,7 +605,7 @@ struct ms_info { ...@@ -605,7 +605,7 @@ struct ms_info {
u32 total_sec_cnt; u32 total_sec_cnt;
u8 last_rw_int; u8 last_rw_int;
struct ms_delay_write_tag delay_write; struct rts51x_ms_delay_write_tag delay_write;
int counter; int counter;
...@@ -671,7 +671,7 @@ struct rts51x_chip { ...@@ -671,7 +671,7 @@ struct rts51x_chip {
u32 capacity[MAX_ALLOWED_LUN_CNT]; u32 capacity[MAX_ALLOWED_LUN_CNT];
/* read/write card function pointer */ /* read/write card function pointer */
card_rw_func rw_card[MAX_ALLOWED_LUN_CNT]; rts51x_card_rw_func rw_card[MAX_ALLOWED_LUN_CNT];
/* read/write capacity, used for GPIO Toggle */ /* read/write capacity, used for GPIO Toggle */
u32 rw_cap[MAX_ALLOWED_LUN_CNT]; u32 rw_cap[MAX_ALLOWED_LUN_CNT];
/* card to lun mapping table */ /* card to lun mapping table */
......
...@@ -70,7 +70,7 @@ static int rts51x_sd_direct_cmnd(struct rts51x_chip *chip, ...@@ -70,7 +70,7 @@ static int rts51x_sd_direct_cmnd(struct rts51x_chip *chip,
switch (dir) { switch (dir) {
case 0: case 0:
/* No data */ /* No data */
retval = ext_sd_execute_no_data(chip, chip->card2lun[SD_CARD], retval = ext_rts51x_sd_execute_no_data(chip, chip->card2lun[SD_CARD],
cmd_idx, standby, acmd, cmd_idx, standby, acmd,
rsp_code, arg); rsp_code, arg);
if (retval != TRANSPORT_GOOD) if (retval != TRANSPORT_GOOD)
...@@ -83,7 +83,7 @@ static int rts51x_sd_direct_cmnd(struct rts51x_chip *chip, ...@@ -83,7 +83,7 @@ static int rts51x_sd_direct_cmnd(struct rts51x_chip *chip,
if (!buf) if (!buf)
TRACE_RET(chip, STATUS_NOMEM); TRACE_RET(chip, STATUS_NOMEM);
retval = ext_sd_execute_read_data(chip, chip->card2lun[SD_CARD], retval = ext_rts51x_sd_execute_read_data(chip, chip->card2lun[SD_CARD],
cmd_idx, cmd12, standby, acmd, cmd_idx, cmd12, standby, acmd,
rsp_code, arg, len, buf, rsp_code, arg, len, buf,
cmnd->buf_len, 0); cmnd->buf_len, 0);
...@@ -117,7 +117,7 @@ static int rts51x_sd_direct_cmnd(struct rts51x_chip *chip, ...@@ -117,7 +117,7 @@ static int rts51x_sd_direct_cmnd(struct rts51x_chip *chip,
} }
retval = retval =
ext_sd_execute_write_data(chip, chip->card2lun[SD_CARD], ext_rts51x_sd_execute_write_data(chip, chip->card2lun[SD_CARD],
cmd_idx, cmd12, standby, acmd, cmd_idx, cmd12, standby, acmd,
rsp_code, arg, len, buf, rsp_code, arg, len, buf,
cmnd->buf_len, 0); cmnd->buf_len, 0);
......
This diff is collapsed.
...@@ -133,9 +133,9 @@ struct rts51x_chip; ...@@ -133,9 +133,9 @@ struct rts51x_chip;
#define SCSI 0x00 /* Interface ID */ #define SCSI 0x00 /* Interface ID */
void scsi_show_command(struct scsi_cmnd *srb); void rts51x_scsi_show_command(struct scsi_cmnd *srb);
void set_sense_type(struct rts51x_chip *chip, unsigned int lun, int sense_type); void rts51x_set_sense_type(struct rts51x_chip *chip, unsigned int lun, int sense_type);
void set_sense_data(struct rts51x_chip *chip, unsigned int lun, u8 err_code, void rts51x_set_sense_data(struct rts51x_chip *chip, unsigned int lun, u8 err_code,
u8 sense_key, u32 info, u8 asc, u8 ascq, u8 sns_key_info0, u8 sense_key, u32 info, u8 asc, u8 ascq, u8 sns_key_info0,
u16 sns_key_info1); u16 sns_key_info1);
......
...@@ -680,7 +680,7 @@ static int sd_set_init_para(struct rts51x_chip *chip) ...@@ -680,7 +680,7 @@ static int sd_set_init_para(struct rts51x_chip *chip)
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
int sd_select_card(struct rts51x_chip *chip, int select) int rts51x_sd_select_card(struct rts51x_chip *chip, int select)
{ {
struct sd_info *sd_card = &(chip->sd_card); struct sd_info *sd_card = &(chip->sd_card);
int retval; int retval;
...@@ -1747,7 +1747,7 @@ static int mmc_ddr_tuning(struct rts51x_chip *chip) ...@@ -1747,7 +1747,7 @@ static int mmc_ddr_tuning(struct rts51x_chip *chip)
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
int sd_switch_clock(struct rts51x_chip *chip) int rts51x_sd_switch_clock(struct rts51x_chip *chip)
{ {
struct sd_info *sd_card = &(chip->sd_card); struct sd_info *sd_card = &(chip->sd_card);
int retval; int retval;
...@@ -1913,7 +1913,7 @@ static int sd_init_power(struct rts51x_chip *chip) ...@@ -1913,7 +1913,7 @@ static int sd_init_power(struct rts51x_chip *chip)
#endif #endif
/* Power on card */ /* Power on card */
retval = card_power_on(chip, SD_CARD); retval = rts51x_card_power_on(chip, SD_CARD);
if (retval != STATUS_SUCCESS) if (retval != STATUS_SUCCESS)
TRACE_RET(chip, retval); TRACE_RET(chip, retval);
...@@ -2139,7 +2139,7 @@ int reset_sd(struct rts51x_chip *chip) ...@@ -2139,7 +2139,7 @@ int reset_sd(struct rts51x_chip *chip)
if (retval != STATUS_SUCCESS) if (retval != STATUS_SUCCESS)
TRACE_RET(chip, retval); TRACE_RET(chip, retval);
/* Select SD card */ /* Select SD card */
retval = sd_select_card(chip, 1); retval = rts51x_sd_select_card(chip, 1);
if (retval != STATUS_SUCCESS) if (retval != STATUS_SUCCESS)
TRACE_RET(chip, retval); TRACE_RET(chip, retval);
...@@ -2656,7 +2656,7 @@ static int reset_mmc(struct rts51x_chip *chip) ...@@ -2656,7 +2656,7 @@ static int reset_mmc(struct rts51x_chip *chip)
spec_ver = (sd_card->raw_csd[0] & 0x3C) >> 2; spec_ver = (sd_card->raw_csd[0] & 0x3C) >> 2;
/* Select MMC card */ /* Select MMC card */
retval = sd_select_card(chip, 1); retval = rts51x_sd_select_card(chip, 1);
if (retval != STATUS_SUCCESS) if (retval != STATUS_SUCCESS)
TRACE_RET(chip, retval); TRACE_RET(chip, retval);
...@@ -2748,7 +2748,7 @@ static int reset_mmc(struct rts51x_chip *chip) ...@@ -2748,7 +2748,7 @@ static int reset_mmc(struct rts51x_chip *chip)
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
int reset_sd_card(struct rts51x_chip *chip) int rts51x_reset_sd_card(struct rts51x_chip *chip)
{ {
struct sd_info *sd_card = &(chip->sd_card); struct sd_info *sd_card = &(chip->sd_card);
int retval; int retval;
...@@ -2764,7 +2764,7 @@ int reset_sd_card(struct rts51x_chip *chip) ...@@ -2764,7 +2764,7 @@ int reset_sd_card(struct rts51x_chip *chip)
sd_card->sd_switch_fail = 0; sd_card->sd_switch_fail = 0;
sd_clear_reset_fail(chip); sd_clear_reset_fail(chip);
enable_card_clock(chip, SD_CARD); rts51x_enable_card_clock(chip, SD_CARD);
sd_init_power(chip); sd_init_power(chip);
...@@ -2891,7 +2891,7 @@ static void sd_stop_seq_mode(struct rts51x_chip *chip) ...@@ -2891,7 +2891,7 @@ static void sd_stop_seq_mode(struct rts51x_chip *chip)
int retval; int retval;
if (sd_card->seq_mode) { if (sd_card->seq_mode) {
retval = sd_switch_clock(chip); retval = rts51x_sd_switch_clock(chip);
if (retval != STATUS_SUCCESS) if (retval != STATUS_SUCCESS)
return; return;
...@@ -2923,14 +2923,14 @@ static inline int sd_auto_tune_clock(struct rts51x_chip *chip) ...@@ -2923,14 +2923,14 @@ static inline int sd_auto_tune_clock(struct rts51x_chip *chip)
sd_card->sd_clock = CLK_50; sd_card->sd_clock = CLK_50;
} }
retval = sd_switch_clock(chip); retval = rts51x_sd_switch_clock(chip);
if (retval != STATUS_SUCCESS) if (retval != STATUS_SUCCESS)
TRACE_RET(chip, retval); TRACE_RET(chip, retval);
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
int sd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector, int rts51x_sd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector,
u16 sector_cnt) u16 sector_cnt)
{ {
struct sd_info *sd_card = &(chip->sd_card); struct sd_info *sd_card = &(chip->sd_card);
...@@ -2947,11 +2947,11 @@ int sd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector, ...@@ -2947,11 +2947,11 @@ int sd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector,
else else
data_addr = start_sector; data_addr = start_sector;
RTS51X_DEBUGP("sd_rw, data_addr = 0x%x\n", data_addr); RTS51X_DEBUGP("rts51x_sd_rw, data_addr = 0x%x\n", data_addr);
sd_clr_err_code(chip); sd_clr_err_code(chip);
retval = sd_switch_clock(chip); retval = rts51x_sd_switch_clock(chip);
if (retval != STATUS_SUCCESS) if (retval != STATUS_SUCCESS)
TRACE_RET(chip, retval); TRACE_RET(chip, retval);
...@@ -3020,7 +3020,7 @@ int sd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector, ...@@ -3020,7 +3020,7 @@ int sd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector,
SD_NO_WAIT_BUSY_END | SD_NO_CHECK_CRC7 | SD_NO_WAIT_BUSY_END | SD_NO_CHECK_CRC7 |
SD_RSP_LEN_0); SD_RSP_LEN_0);
trans_dma_enable(srb->sc_data_direction, chip, sector_cnt * 512, rts51x_trans_dma_enable(srb->sc_data_direction, chip, sector_cnt * 512,
DMA_512); DMA_512);
if (srb->sc_data_direction == DMA_FROM_DEVICE) { if (srb->sc_data_direction == DMA_FROM_DEVICE) {
...@@ -3058,7 +3058,7 @@ int sd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector, ...@@ -3058,7 +3058,7 @@ int sd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector,
SD_NO_WAIT_BUSY_END | SD_CHECK_CRC7 | SD_NO_WAIT_BUSY_END | SD_CHECK_CRC7 |
SD_RSP_LEN_6); SD_RSP_LEN_6);
trans_dma_enable(srb->sc_data_direction, chip, rts51x_trans_dma_enable(srb->sc_data_direction, chip,
sector_cnt * 512, DMA_512); sector_cnt * 512, DMA_512);
rts51x_add_cmd(chip, WRITE_REG_CMD, SD_TRANSFER, 0xFF, rts51x_add_cmd(chip, WRITE_REG_CMD, SD_TRANSFER, 0xFF,
...@@ -3099,7 +3099,7 @@ int sd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector, ...@@ -3099,7 +3099,7 @@ int sd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector,
SD_NO_WAIT_BUSY_END | SD_NO_CHECK_CRC7 | SD_NO_WAIT_BUSY_END | SD_NO_CHECK_CRC7 |
SD_RSP_LEN_0); SD_RSP_LEN_0);
trans_dma_enable(srb->sc_data_direction, chip, rts51x_trans_dma_enable(srb->sc_data_direction, chip,
sector_cnt * 512, DMA_512); sector_cnt * 512, DMA_512);
rts51x_add_cmd(chip, WRITE_REG_CMD, SD_TRANSFER, 0xFF, rts51x_add_cmd(chip, WRITE_REG_CMD, SD_TRANSFER, 0xFF,
...@@ -3168,7 +3168,7 @@ int sd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector, ...@@ -3168,7 +3168,7 @@ int sd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector,
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
void sd_cleanup_work(struct rts51x_chip *chip) void rts51x_sd_cleanup_work(struct rts51x_chip *chip)
{ {
struct sd_info *sd_card = &(chip->sd_card); struct sd_info *sd_card = &(chip->sd_card);
...@@ -3220,12 +3220,12 @@ static int sd_power_off_card3v3(struct rts51x_chip *chip) ...@@ -3220,12 +3220,12 @@ static int sd_power_off_card3v3(struct rts51x_chip *chip)
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
int release_sd_card(struct rts51x_chip *chip) int rts51x_release_sd_card(struct rts51x_chip *chip)
{ {
struct sd_info *sd_card = &(chip->sd_card); struct sd_info *sd_card = &(chip->sd_card);
int retval; int retval;
RTS51X_DEBUGP("release_sd_card\n"); RTS51X_DEBUGP("rts51x_release_sd_card\n");
chip->card_ready &= ~SD_CARD; chip->card_ready &= ~SD_CARD;
chip->card_fail &= ~SD_CARD; chip->card_fail &= ~SD_CARD;
......
...@@ -256,13 +256,13 @@ struct timing_phase_path { ...@@ -256,13 +256,13 @@ struct timing_phase_path {
int len; int len;
}; };
int sd_select_card(struct rts51x_chip *chip, int select); int rts51x_sd_select_card(struct rts51x_chip *chip, int select);
int reset_sd_card(struct rts51x_chip *chip); int rts51x_reset_sd_card(struct rts51x_chip *chip);
int sd_switch_clock(struct rts51x_chip *chip); int rts51x_sd_switch_clock(struct rts51x_chip *chip);
int sd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector, int rts51x_sd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector,
u16 sector_cnt); u16 sector_cnt);
void sd_cleanup_work(struct rts51x_chip *chip); void rts51x_sd_cleanup_work(struct rts51x_chip *chip);
int release_sd_card(struct rts51x_chip *chip); int rts51x_release_sd_card(struct rts51x_chip *chip);
#ifdef SUPPORT_CPRM #ifdef SUPPORT_CPRM
extern int reset_sd(struct rts51x_chip *chip); extern int reset_sd(struct rts51x_chip *chip);
......
This diff is collapsed.
...@@ -31,24 +31,24 @@ ...@@ -31,24 +31,24 @@
#include "sd.h" #include "sd.h"
#ifdef SUPPORT_CPRM #ifdef SUPPORT_CPRM
int ext_sd_execute_no_data(struct rts51x_chip *chip, unsigned int lun, int ext_rts51x_sd_execute_no_data(struct rts51x_chip *chip, unsigned int lun,
u8 cmd_idx, u8 standby, u8 acmd, u8 rsp_code, u8 cmd_idx, u8 standby, u8 acmd, u8 rsp_code,
u32 arg); u32 arg);
int ext_sd_execute_read_data(struct rts51x_chip *chip, unsigned int lun, int ext_rts51x_sd_execute_read_data(struct rts51x_chip *chip, unsigned int lun,
u8 cmd_idx, u8 cmd12, u8 standby, u8 acmd, u8 cmd_idx, u8 cmd12, u8 standby, u8 acmd,
u8 rsp_code, u32 arg, u32 data_len, void *data_buf, u8 rsp_code, u32 arg, u32 data_len, void *data_buf,
unsigned int buf_len, int use_sg); unsigned int buf_len, int use_sg);
int ext_sd_execute_write_data(struct rts51x_chip *chip, unsigned int lun, int ext_rts51x_sd_execute_write_data(struct rts51x_chip *chip, unsigned int lun,
u8 cmd_idx, u8 cmd12, u8 standby, u8 acmd, u8 cmd_idx, u8 cmd12, u8 standby, u8 acmd,
u8 rsp_code, u32 arg, u32 data_len, u8 rsp_code, u32 arg, u32 data_len,
void *data_buf, unsigned int buf_len, int use_sg); void *data_buf, unsigned int buf_len, int use_sg);
int sd_pass_thru_mode(struct scsi_cmnd *srb, struct rts51x_chip *chip); int rts51x_sd_pass_thru_mode(struct scsi_cmnd *srb, struct rts51x_chip *chip);
int sd_execute_no_data(struct scsi_cmnd *srb, struct rts51x_chip *chip); int rts51x_sd_execute_no_data(struct scsi_cmnd *srb, struct rts51x_chip *chip);
int sd_execute_read_data(struct scsi_cmnd *srb, struct rts51x_chip *chip); int rts51x_sd_execute_read_data(struct scsi_cmnd *srb, struct rts51x_chip *chip);
int sd_execute_write_data(struct scsi_cmnd *srb, struct rts51x_chip *chip); int rts51x_sd_execute_write_data(struct scsi_cmnd *srb, struct rts51x_chip *chip);
int sd_get_cmd_rsp(struct scsi_cmnd *srb, struct rts51x_chip *chip); int rts51x_sd_get_cmd_rsp(struct scsi_cmnd *srb, struct rts51x_chip *chip);
int sd_hw_rst(struct scsi_cmnd *srb, struct rts51x_chip *chip); int rts51x_sd_hw_rst(struct scsi_cmnd *srb, struct rts51x_chip *chip);
#endif #endif
#endif /* __RTS51X_SD_CPRM_H */ #endif /* __RTS51X_SD_CPRM_H */
...@@ -425,7 +425,7 @@ static int reset_xd(struct rts51x_chip *chip) ...@@ -425,7 +425,7 @@ static int reset_xd(struct rts51x_chip *chip)
} }
#endif #endif
retval = card_power_on(chip, XD_CARD); retval = rts51x_card_power_on(chip, XD_CARD);
if (retval != STATUS_SUCCESS) if (retval != STATUS_SUCCESS)
TRACE_RET(chip, retval); TRACE_RET(chip, retval);
#ifdef SUPPORT_OCP #ifdef SUPPORT_OCP
...@@ -472,8 +472,8 @@ static int reset_xd(struct rts51x_chip *chip) ...@@ -472,8 +472,8 @@ static int reset_xd(struct rts51x_chip *chip)
rts51x_init_cmd(chip); rts51x_init_cmd(chip);
rts51x_add_cmd(chip, WRITE_REG_CMD, XD_DTCTL, 0xFF, rts51x_add_cmd(chip, WRITE_REG_CMD, XD_DTCTL, 0xFF,
XD_TIME_SETUP_STEP * 3 + XD_TIME_RW_STEP * XD_TIME_SETUP_STEP * 3 + XD_TIME_RW_STEP *
(2 + i + chip->option.xd_rw_step) (2 + i + chip->option.rts51x_xd_rw_step)
+ XD_TIME_RWN_STEP * (i + chip->option.xd_rwn_step)); + XD_TIME_RWN_STEP * (i + chip->option.rts51x_xd_rwn_step));
rts51x_add_cmd(chip, WRITE_REG_CMD, XD_CATCTL, 0xFF, rts51x_add_cmd(chip, WRITE_REG_CMD, XD_CATCTL, 0xFF,
XD_TIME_SETUP_STEP * 3 + XD_TIME_RW_STEP * (4 + XD_TIME_SETUP_STEP * 3 + XD_TIME_RW_STEP * (4 +
i) + XD_TIME_RWN_STEP * (3 + i)); i) + XD_TIME_RWN_STEP * (3 + i));
...@@ -905,7 +905,7 @@ static u32 xd_get_l2p_tbl(struct rts51x_chip *chip, int zone_no, u16 log_off) ...@@ -905,7 +905,7 @@ static u32 xd_get_l2p_tbl(struct rts51x_chip *chip, int zone_no, u16 log_off)
return (u32) zone->l2p_table[log_off] + ((u32) (zone_no) << 10); return (u32) zone->l2p_table[log_off] + ((u32) (zone_no) << 10);
} }
int reset_xd_card(struct rts51x_chip *chip) int rts51x_reset_xd_card(struct rts51x_chip *chip)
{ {
struct xd_info *xd_card = &(chip->xd_card); struct xd_info *xd_card = &(chip->xd_card);
int retval; int retval;
...@@ -920,7 +920,7 @@ int reset_xd_card(struct rts51x_chip *chip) ...@@ -920,7 +920,7 @@ int reset_xd_card(struct rts51x_chip *chip)
xd_card->cis_block = 0xFFFF; xd_card->cis_block = 0xFFFF;
xd_card->delay_write.delay_write_flag = 0; xd_card->delay_write.delay_write_flag = 0;
enable_card_clock(chip, XD_CARD); rts51x_enable_card_clock(chip, XD_CARD);
retval = reset_xd(chip); retval = reset_xd(chip);
if (retval != STATUS_SUCCESS) { if (retval != STATUS_SUCCESS) {
...@@ -1526,7 +1526,7 @@ static int xd_read_multiple_pages(struct rts51x_chip *chip, u32 phy_blk, ...@@ -1526,7 +1526,7 @@ static int xd_read_multiple_pages(struct rts51x_chip *chip, u32 phy_blk,
rts51x_add_cmd(chip, WRITE_REG_CMD, XD_CHK_DATA_STATUS, rts51x_add_cmd(chip, WRITE_REG_CMD, XD_CHK_DATA_STATUS,
XD_AUTO_CHK_DATA_STATUS, XD_AUTO_CHK_DATA_STATUS); XD_AUTO_CHK_DATA_STATUS, XD_AUTO_CHK_DATA_STATUS);
trans_dma_enable(chip->srb->sc_data_direction, chip, page_cnt * 512, rts51x_trans_dma_enable(chip->srb->sc_data_direction, chip, page_cnt * 512,
DMA_512); DMA_512);
rts51x_add_cmd(chip, WRITE_REG_CMD, XD_TRANSFER, 0xFF, rts51x_add_cmd(chip, WRITE_REG_CMD, XD_TRANSFER, 0xFF,
...@@ -1745,7 +1745,7 @@ static int xd_write_multiple_pages(struct rts51x_chip *chip, u32 old_blk, ...@@ -1745,7 +1745,7 @@ static int xd_write_multiple_pages(struct rts51x_chip *chip, u32 old_blk,
rts51x_add_cmd(chip, WRITE_REG_CMD, CARD_DATA_SOURCE, 0x01, rts51x_add_cmd(chip, WRITE_REG_CMD, CARD_DATA_SOURCE, 0x01,
RING_BUFFER); RING_BUFFER);
trans_dma_enable(chip->srb->sc_data_direction, chip, page_cnt * 512, rts51x_trans_dma_enable(chip->srb->sc_data_direction, chip, page_cnt * 512,
DMA_512); DMA_512);
rts51x_add_cmd(chip, WRITE_REG_CMD, XD_TRANSFER, 0xFF, rts51x_add_cmd(chip, WRITE_REG_CMD, XD_TRANSFER, 0xFF,
...@@ -1842,7 +1842,7 @@ static int xd_delay_write(struct rts51x_chip *chip) ...@@ -1842,7 +1842,7 @@ static int xd_delay_write(struct rts51x_chip *chip)
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector, int rts51x_xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector,
u16 sector_cnt) u16 sector_cnt)
{ {
struct xd_info *xd_card = &(chip->xd_card); struct xd_info *xd_card = &(chip->xd_card);
...@@ -1860,7 +1860,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector, ...@@ -1860,7 +1860,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector,
xd_card->counter = 0; xd_card->counter = 0;
RTS51X_DEBUGP("xd_rw: scsi_bufflen = %d, scsi_sg_count = %d\n", RTS51X_DEBUGP("rts51x_xd_rw: scsi_bufflen = %d, scsi_sg_count = %d\n",
scsi_bufflen(srb), scsi_sg_count(srb)); scsi_bufflen(srb), scsi_sg_count(srb));
RTS51X_DEBUGP("Data direction: %s\n", RTS51X_DEBUGP("Data direction: %s\n",
(srb->sc_data_direction == (srb->sc_data_direction ==
...@@ -1883,7 +1883,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector, ...@@ -1883,7 +1883,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector,
retval = xd_build_l2p_tbl(chip, zone_no); retval = xd_build_l2p_tbl(chip, zone_no);
if (retval != STATUS_SUCCESS) { if (retval != STATUS_SUCCESS) {
chip->card_fail |= XD_CARD; chip->card_fail |= XD_CARD;
set_sense_type(chip, lun, SENSE_TYPE_MEDIA_NOT_PRESENT); rts51x_set_sense_type(chip, lun, SENSE_TYPE_MEDIA_NOT_PRESENT);
TRACE_RET(chip, retval); TRACE_RET(chip, retval);
} }
} }
...@@ -1900,7 +1900,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector, ...@@ -1900,7 +1900,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector,
delay_write->pageoff, delay_write->pageoff,
start_page); start_page);
if (retval != STATUS_SUCCESS) { if (retval != STATUS_SUCCESS) {
set_sense_type(chip, lun, rts51x_set_sense_type(chip, lun,
SENSE_TYPE_MEDIA_WRITE_ERR); SENSE_TYPE_MEDIA_WRITE_ERR);
TRACE_RET(chip, retval); TRACE_RET(chip, retval);
} }
...@@ -1916,7 +1916,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector, ...@@ -1916,7 +1916,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector,
} else { } else {
retval = xd_delay_write(chip); retval = xd_delay_write(chip);
if (retval != STATUS_SUCCESS) { if (retval != STATUS_SUCCESS) {
set_sense_type(chip, lun, rts51x_set_sense_type(chip, lun,
SENSE_TYPE_MEDIA_WRITE_ERR); SENSE_TYPE_MEDIA_WRITE_ERR);
TRACE_RET(chip, retval); TRACE_RET(chip, retval);
} }
...@@ -1924,7 +1924,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector, ...@@ -1924,7 +1924,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector,
new_blk = xd_get_unused_block(chip, zone_no); new_blk = xd_get_unused_block(chip, zone_no);
if ((old_blk == BLK_NOT_FOUND) if ((old_blk == BLK_NOT_FOUND)
|| (new_blk == BLK_NOT_FOUND)) { || (new_blk == BLK_NOT_FOUND)) {
set_sense_type(chip, lun, rts51x_set_sense_type(chip, lun,
SENSE_TYPE_MEDIA_WRITE_ERR); SENSE_TYPE_MEDIA_WRITE_ERR);
TRACE_RET(chip, retval); TRACE_RET(chip, retval);
} }
...@@ -1935,11 +1935,11 @@ int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector, ...@@ -1935,11 +1935,11 @@ int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector,
if (retval != STATUS_SUCCESS) { if (retval != STATUS_SUCCESS) {
if (monitor_card_cd(chip, XD_CARD) == if (monitor_card_cd(chip, XD_CARD) ==
CD_NOT_EXIST) { CD_NOT_EXIST) {
set_sense_type(chip, lun, rts51x_set_sense_type(chip, lun,
SENSE_TYPE_MEDIA_NOT_PRESENT); SENSE_TYPE_MEDIA_NOT_PRESENT);
TRACE_RET(chip, STATUS_FAIL); TRACE_RET(chip, STATUS_FAIL);
} }
set_sense_type(chip, lun, rts51x_set_sense_type(chip, lun,
SENSE_TYPE_MEDIA_WRITE_ERR); SENSE_TYPE_MEDIA_WRITE_ERR);
TRACE_RET(chip, retval); TRACE_RET(chip, retval);
} }
...@@ -1948,18 +1948,18 @@ int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector, ...@@ -1948,18 +1948,18 @@ int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector,
retval = xd_delay_write(chip); retval = xd_delay_write(chip);
if (retval != STATUS_SUCCESS) { if (retval != STATUS_SUCCESS) {
if (monitor_card_cd(chip, XD_CARD) == CD_NOT_EXIST) { if (monitor_card_cd(chip, XD_CARD) == CD_NOT_EXIST) {
set_sense_type(chip, lun, rts51x_set_sense_type(chip, lun,
SENSE_TYPE_MEDIA_NOT_PRESENT); SENSE_TYPE_MEDIA_NOT_PRESENT);
TRACE_RET(chip, STATUS_FAIL); TRACE_RET(chip, STATUS_FAIL);
} }
set_sense_type(chip, lun, rts51x_set_sense_type(chip, lun,
SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR); SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR);
TRACE_RET(chip, retval); TRACE_RET(chip, retval);
} }
old_blk = xd_get_l2p_tbl(chip, zone_no, log_off); old_blk = xd_get_l2p_tbl(chip, zone_no, log_off);
if (old_blk == BLK_NOT_FOUND) { if (old_blk == BLK_NOT_FOUND) {
set_sense_type(chip, lun, rts51x_set_sense_type(chip, lun,
SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR); SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR);
TRACE_RET(chip, STATUS_FAIL); TRACE_RET(chip, STATUS_FAIL);
} }
...@@ -1980,7 +1980,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector, ...@@ -1980,7 +1980,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector,
start_page, end_page, start_page, end_page,
buf, &ptr, &offset); buf, &ptr, &offset);
if (retval != STATUS_SUCCESS) { if (retval != STATUS_SUCCESS) {
set_sense_type(chip, lun, rts51x_set_sense_type(chip, lun,
SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR); SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR);
TRACE_RET(chip, STATUS_FAIL); TRACE_RET(chip, STATUS_FAIL);
} }
...@@ -1991,7 +1991,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector, ...@@ -1991,7 +1991,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector,
end_page, buf, &ptr, end_page, buf, &ptr,
&offset); &offset);
if (retval != STATUS_SUCCESS) { if (retval != STATUS_SUCCESS) {
set_sense_type(chip, lun, rts51x_set_sense_type(chip, lun,
SENSE_TYPE_MEDIA_WRITE_ERR); SENSE_TYPE_MEDIA_WRITE_ERR);
TRACE_RET(chip, STATUS_FAIL); TRACE_RET(chip, STATUS_FAIL);
} }
...@@ -2010,7 +2010,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector, ...@@ -2010,7 +2010,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector,
retval = xd_build_l2p_tbl(chip, zone_no); retval = xd_build_l2p_tbl(chip, zone_no);
if (retval != STATUS_SUCCESS) { if (retval != STATUS_SUCCESS) {
chip->card_fail |= XD_CARD; chip->card_fail |= XD_CARD;
set_sense_type(chip, lun, rts51x_set_sense_type(chip, lun,
SENSE_TYPE_MEDIA_NOT_PRESENT); SENSE_TYPE_MEDIA_NOT_PRESENT);
TRACE_RET(chip, retval); TRACE_RET(chip, retval);
} }
...@@ -2019,10 +2019,10 @@ int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector, ...@@ -2019,10 +2019,10 @@ int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector,
old_blk = xd_get_l2p_tbl(chip, zone_no, log_off); old_blk = xd_get_l2p_tbl(chip, zone_no, log_off);
if (old_blk == BLK_NOT_FOUND) { if (old_blk == BLK_NOT_FOUND) {
if (srb->sc_data_direction == DMA_FROM_DEVICE) { if (srb->sc_data_direction == DMA_FROM_DEVICE) {
set_sense_type(chip, lun, rts51x_set_sense_type(chip, lun,
SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR); SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR);
} else { } else {
set_sense_type(chip, lun, rts51x_set_sense_type(chip, lun,
SENSE_TYPE_MEDIA_WRITE_ERR); SENSE_TYPE_MEDIA_WRITE_ERR);
} }
TRACE_RET(chip, STATUS_FAIL); TRACE_RET(chip, STATUS_FAIL);
...@@ -2031,7 +2031,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector, ...@@ -2031,7 +2031,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector,
if (srb->sc_data_direction == DMA_TO_DEVICE) { if (srb->sc_data_direction == DMA_TO_DEVICE) {
new_blk = xd_get_unused_block(chip, zone_no); new_blk = xd_get_unused_block(chip, zone_no);
if (new_blk == BLK_NOT_FOUND) { if (new_blk == BLK_NOT_FOUND) {
set_sense_type(chip, lun, rts51x_set_sense_type(chip, lun,
SENSE_TYPE_MEDIA_WRITE_ERR); SENSE_TYPE_MEDIA_WRITE_ERR);
TRACE_RET(chip, STATUS_FAIL); TRACE_RET(chip, STATUS_FAIL);
} }
...@@ -2054,7 +2054,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector, ...@@ -2054,7 +2054,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector,
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
void xd_free_l2p_tbl(struct rts51x_chip *chip) void rts51x_xd_free_l2p_tbl(struct rts51x_chip *chip)
{ {
struct xd_info *xd_card = &(chip->xd_card); struct xd_info *xd_card = &(chip->xd_card);
int i = 0; int i = 0;
...@@ -2075,7 +2075,7 @@ void xd_free_l2p_tbl(struct rts51x_chip *chip) ...@@ -2075,7 +2075,7 @@ void xd_free_l2p_tbl(struct rts51x_chip *chip)
} }
} }
void xd_cleanup_work(struct rts51x_chip *chip) void rts51x_xd_cleanup_work(struct rts51x_chip *chip)
{ {
struct xd_info *xd_card = &(chip->xd_card); struct xd_info *xd_card = &(chip->xd_card);
...@@ -2115,12 +2115,12 @@ static int xd_power_off_card3v3(struct rts51x_chip *chip) ...@@ -2115,12 +2115,12 @@ static int xd_power_off_card3v3(struct rts51x_chip *chip)
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
int release_xd_card(struct rts51x_chip *chip) int rts51x_release_xd_card(struct rts51x_chip *chip)
{ {
struct xd_info *xd_card = &(chip->xd_card); struct xd_info *xd_card = &(chip->xd_card);
int retval; int retval;
RTS51X_DEBUGP("release_xd_card\n"); RTS51X_DEBUGP("rts51x_release_xd_card\n");
chip->card_ready &= ~XD_CARD; chip->card_ready &= ~XD_CARD;
chip->card_fail &= ~XD_CARD; chip->card_fail &= ~XD_CARD;
...@@ -2128,7 +2128,7 @@ int release_xd_card(struct rts51x_chip *chip) ...@@ -2128,7 +2128,7 @@ int release_xd_card(struct rts51x_chip *chip)
xd_card->delay_write.delay_write_flag = 0; xd_card->delay_write.delay_write_flag = 0;
xd_free_l2p_tbl(chip); rts51x_xd_free_l2p_tbl(chip);
rts51x_write_register(chip, SFSM_ED, HW_CMD_STOP, HW_CMD_STOP); rts51x_write_register(chip, SFSM_ED, HW_CMD_STOP, HW_CMD_STOP);
......
...@@ -181,11 +181,11 @@ ...@@ -181,11 +181,11 @@
#define CIS1_8 (256 + 8) #define CIS1_8 (256 + 8)
#define CIS1_9 (256 + 9) #define CIS1_9 (256 + 9)
int reset_xd_card(struct rts51x_chip *chip); int rts51x_reset_xd_card(struct rts51x_chip *chip);
int xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector, int rts51x_xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector,
u16 sector_cnt); u16 sector_cnt);
void xd_free_l2p_tbl(struct rts51x_chip *chip); void rts51x_xd_free_l2p_tbl(struct rts51x_chip *chip);
void xd_cleanup_work(struct rts51x_chip *chip); void rts51x_xd_cleanup_work(struct rts51x_chip *chip);
int release_xd_card(struct rts51x_chip *chip); int rts51x_release_xd_card(struct rts51x_chip *chip);
#endif /* __RTS51X_XD_H */ #endif /* __RTS51X_XD_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment