xpp: remove unused XPD_STATE() "protocol method"

Folded XPD_STATE() "protocol method" into the card_state() method.
It was only called from these (otherwise empty) methods.

Also it is not a "protocol method" for a very very very long time.

Signed-off-by: Oron Peled <oron@actcom.co.il>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9715 a0bf4364-ded3-4de4-8d8a-66a801d63aff
This commit is contained in:
Oron Peled 2011-01-30 18:31:35 +00:00 committed by Tzafrir Cohen
parent 38f916050a
commit 63ccf9b7da
4 changed files with 34 additions and 57 deletions

View File

@ -1443,27 +1443,10 @@ static void BRI_card_pcm_tospan(xpd_t *xpd, xpacket_t *pack)
}
}
/*---------------- BRI: HOST COMMANDS -------------------------------------*/
static /* 0x0F */ HOSTCMD(BRI, XPD_STATE, bool on)
{
struct BRI_priv_data *priv;
BUG_ON(!xpd);
priv = xpd->priv;
XPD_DBG(GENERAL, xpd, "%s\n", (on)?"ON":"OFF");
if(on) {
if(!test_bit(HFC_L1_ACTIVATED, &priv->l1_flags)) {
if( ! IS_NT(xpd))
te_activation(xpd, 1);
else
nt_activation(xpd, 1);
}
} else if(IS_NT(xpd))
nt_activation(xpd, 0);
return 0;
}
static /* 0x33 */ HOSTCMD(BRI, SET_LED, enum bri_led_names which_led, enum led_state to_led_state)
{
int ret = 0;
@ -1671,7 +1654,21 @@ end:
static int BRI_card_state(xpd_t *xpd, bool on)
{
return CALL_PROTO(BRI, XPD_STATE, xpd->xbus, xpd, on);
struct BRI_priv_data *priv;
BUG_ON(!xpd);
priv = xpd->priv;
XPD_DBG(GENERAL, xpd, "%s\n", (on)?"ON":"OFF");
if(on) {
if(!test_bit(HFC_L1_ACTIVATED, &priv->l1_flags)) {
if( ! IS_NT(xpd))
te_activation(xpd, 1);
else
nt_activation(xpd, 1);
}
} else if(IS_NT(xpd))
nt_activation(xpd, 0);
return 0;
}
static const struct xops bri_xops = {

View File

@ -83,8 +83,6 @@ enum fxo_leds {
/*---------------- FXO Protocol Commands ----------------------------------*/
static /* 0x0F */ DECLARE_CMD(FXO, XPD_STATE, bool on);
static bool fxo_packet_is_valid(xpacket_t *pack);
static void fxo_packet_dump(const char *msg, xpacket_t *pack);
#ifdef CONFIG_PROC_FS
@ -511,7 +509,7 @@ static int FXO_card_dahdi_preregistration(xpd_t *xpd, bool on)
BUG_ON(!priv);
timer_count = xpd->timer_count;
XPD_DBG(GENERAL, xpd, "%s\n", (on)?"ON":"OFF");
PHONEDEV(xpd).span.spantype = "FXO";
PHONEDEV(xpd).span.spantype = "FXO";
for_each_line(xpd, i) {
struct dahdi_chan *cur_chan = XPD_CHAN(xpd, i);
@ -832,19 +830,6 @@ static int FXO_card_ioctl(xpd_t *xpd, int pos, unsigned int cmd, unsigned long a
/*---------------- FXO: HOST COMMANDS -------------------------------------*/
static /* 0x0F */ HOSTCMD(FXO, XPD_STATE, bool on)
{
int ret = 0;
struct FXO_priv_data *priv;
BUG_ON(!xbus);
BUG_ON(!xpd);
priv = xpd->priv;
BUG_ON(!priv);
XPD_DBG(GENERAL, xpd, "%s\n", (on) ? "on" : "off");
return ret;
}
/*---------------- FXO: Astribank Reply Handlers --------------------------*/
HANDLER_DEF(FXO, SIG_CHANGED)
@ -1113,7 +1098,14 @@ static int FXO_card_register_reply(xbus_t *xbus, xpd_t *xpd, reg_cmd_t *info)
static int FXO_card_state(xpd_t *xpd, bool on)
{
return CALL_PROTO(FXO, XPD_STATE, xpd->xbus, xpd, on);
int ret = 0;
struct FXO_priv_data *priv;
BUG_ON(!xpd);
priv = xpd->priv;
BUG_ON(!priv);
XPD_DBG(GENERAL, xpd, "%s\n", (on) ? "on" : "off");
return ret;
}
static const struct xops fxo_xops = {

View File

@ -104,8 +104,6 @@ enum fxs_state {
/*---------------- FXS Protocol Commands ----------------------------------*/
static /* 0x0F */ DECLARE_CMD(FXS, XPD_STATE, bool on);
static bool fxs_packet_is_valid(xpacket_t *pack);
static void fxs_packet_dump(const char *msg, xpacket_t *pack);
#ifdef CONFIG_PROC_FS
@ -1159,14 +1157,6 @@ static int FXS_card_tick(xbus_t *xbus, xpd_t *xpd)
/*---------------- FXS: HOST COMMANDS -------------------------------------*/
static /* 0x0F */ HOSTCMD(FXS, XPD_STATE, bool on)
{
BUG_ON(!xbus);
BUG_ON(!xpd);
XPD_DBG(GENERAL, xpd, "%s\n", (on)?"on":"off");
return 0;
}
/*---------------- FXS: Astribank Reply Handlers --------------------------*/
/*
@ -1396,7 +1386,9 @@ static int FXS_card_register_reply(xbus_t *xbus, xpd_t *xpd, reg_cmd_t *info)
static int FXS_card_state(xpd_t *xpd, bool on)
{
return CALL_PROTO(FXS, XPD_STATE, xpd->xbus, xpd, on);
BUG_ON(!xpd);
XPD_DBG(GENERAL, xpd, "%s\n", (on)?"on":"off");
return 0;
}
static const struct xops fxs_xops = {

View File

@ -1866,14 +1866,9 @@ int PRI_timing_priority(xpd_t *xpd)
return -ENOENT;
}
/*---------------- PRI: HOST COMMANDS -------------------------------------*/
static /* 0x0F */ HOSTCMD(PRI, XPD_STATE, bool on)
{
BUG_ON(!xpd);
XPD_DBG(GENERAL, xpd, "%s\n", (on)?"on":"off");
return 0;
}
/*---------------- PRI: HOST COMMANDS -------------------------------------*/
static /* 0x33 */ HOSTCMD(PRI, SET_LED, enum pri_led_selectors led_sel, enum pri_led_state to_led_state)
{
@ -2170,7 +2165,9 @@ end:
static int PRI_card_state(xpd_t *xpd, bool on)
{
return CALL_PROTO(PRI, XPD_STATE, xpd->xbus, xpd, on);
BUG_ON(!xpd);
XPD_DBG(GENERAL, xpd, "%s\n", (on)?"on":"off");
return 0;
}
static const struct xops pri_xops = {
@ -2629,7 +2626,6 @@ static DEVICE_ATTR_READER(pri_clocking_show, dev, buf)
static DEVICE_ATTR(pri_clocking, S_IRUGO, pri_clocking_show, NULL);
static int pri_xpd_probe(struct device *dev)
{
xpd_t *xpd;