staging: vt6656: struct vnt_private rename cdTD to num_tx_context
number of tx_context Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Родитель
6da4738f06
Коммит
03b7e3548c
|
@ -293,7 +293,7 @@ struct vnt_private {
|
||||||
|
|
||||||
/* Variables to track resources for the BULK Out Pipe */
|
/* Variables to track resources for the BULK Out Pipe */
|
||||||
struct vnt_usb_send_context *tx_context[CB_MAX_TX_DESC];
|
struct vnt_usb_send_context *tx_context[CB_MAX_TX_DESC];
|
||||||
u32 cbTD;
|
u32 num_tx_context;
|
||||||
|
|
||||||
/* Variables to track resources for the Interrupt In Pipe */
|
/* Variables to track resources for the Interrupt In Pipe */
|
||||||
struct vnt_interrupt_buffer int_buf;
|
struct vnt_interrupt_buffer int_buf;
|
||||||
|
|
|
@ -75,7 +75,7 @@ static int vnt_int_report_rate(struct vnt_private *priv, u8 pkt_no, u8 tsr)
|
||||||
u8 tx_retry = (tsr & 0xf0) >> 4;
|
u8 tx_retry = (tsr & 0xf0) >> 4;
|
||||||
s8 idx;
|
s8 idx;
|
||||||
|
|
||||||
if (pkt_no >= priv->cbTD)
|
if (pkt_no >= priv->num_tx_context)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
context = priv->tx_context[pkt_no];
|
context = priv->tx_context[pkt_no];
|
||||||
|
|
|
@ -108,9 +108,9 @@ static void device_set_options(struct vnt_private *priv)
|
||||||
{
|
{
|
||||||
/* Set number of TX buffers */
|
/* Set number of TX buffers */
|
||||||
if (vnt_tx_buffers < CB_MIN_TX_DESC || vnt_tx_buffers > CB_MAX_TX_DESC)
|
if (vnt_tx_buffers < CB_MIN_TX_DESC || vnt_tx_buffers > CB_MAX_TX_DESC)
|
||||||
priv->cbTD = TX_DESC_DEF0;
|
priv->num_tx_context = TX_DESC_DEF0;
|
||||||
else
|
else
|
||||||
priv->cbTD = vnt_tx_buffers;
|
priv->num_tx_context = vnt_tx_buffers;
|
||||||
|
|
||||||
/* Set number of RX buffers */
|
/* Set number of RX buffers */
|
||||||
if (vnt_rx_buffers < CB_MIN_RX_DESC || vnt_rx_buffers > CB_MAX_RX_DESC)
|
if (vnt_rx_buffers < CB_MIN_RX_DESC || vnt_rx_buffers > CB_MAX_RX_DESC)
|
||||||
|
@ -388,7 +388,7 @@ static void device_free_tx_bufs(struct vnt_private *priv)
|
||||||
struct vnt_usb_send_context *tx_context;
|
struct vnt_usb_send_context *tx_context;
|
||||||
int ii;
|
int ii;
|
||||||
|
|
||||||
for (ii = 0; ii < priv->cbTD; ii++) {
|
for (ii = 0; ii < priv->num_tx_context; ii++) {
|
||||||
tx_context = priv->tx_context[ii];
|
tx_context = priv->tx_context[ii];
|
||||||
/* deallocate URBs */
|
/* deallocate URBs */
|
||||||
if (tx_context->urb) {
|
if (tx_context->urb) {
|
||||||
|
@ -452,7 +452,7 @@ static bool device_alloc_bufs(struct vnt_private *priv)
|
||||||
struct vnt_rcb *rcb;
|
struct vnt_rcb *rcb;
|
||||||
int ii;
|
int ii;
|
||||||
|
|
||||||
for (ii = 0; ii < priv->cbTD; ii++) {
|
for (ii = 0; ii < priv->num_tx_context; ii++) {
|
||||||
tx_context = kmalloc(sizeof(struct vnt_usb_send_context),
|
tx_context = kmalloc(sizeof(struct vnt_usb_send_context),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (tx_context == NULL) {
|
if (tx_context == NULL) {
|
||||||
|
|
|
@ -81,7 +81,7 @@ static struct vnt_usb_send_context
|
||||||
|
|
||||||
dev_dbg(&priv->usb->dev, "%s\n", __func__);
|
dev_dbg(&priv->usb->dev, "%s\n", __func__);
|
||||||
|
|
||||||
for (ii = 0; ii < priv->cbTD; ii++) {
|
for (ii = 0; ii < priv->num_tx_context; ii++) {
|
||||||
if (!priv->tx_context[ii])
|
if (!priv->tx_context[ii])
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ static struct vnt_usb_send_context
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ii == priv->cbTD)
|
if (ii == priv->num_tx_context)
|
||||||
dev_dbg(&priv->usb->dev, "%s No Free Tx Context\n", __func__);
|
dev_dbg(&priv->usb->dev, "%s No Free Tx Context\n", __func__);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче