Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256024
b: refs/heads/master
c: 6e10c46
h: refs/heads/master
v: v3
  • Loading branch information
Dmitry Eremin-Solenikov committed Jun 30, 2011
1 parent 2766087 commit 808dfee
Show file tree
Hide file tree
Showing 70 changed files with 2,296 additions and 2,532 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3e878b8d54e0fc12df363ee8e4a638c8147aac98
refs/heads/master: 6e10c469f0997a5ebaffa955d8716c59ba102a1f
2 changes: 0 additions & 2 deletions trunk/drivers/ieee802154/fakehard.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,6 @@ static int __devinit ieee802154fake_probe(struct platform_device *pdev)
return -ENOMEM;
}

phy->dev.platform_data = dev;

memcpy(dev->dev_addr, "\xba\xbe\xca\xfe\xde\xad\xbe\xef",
dev->addr_len);
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
Expand Down
14 changes: 8 additions & 6 deletions trunk/drivers/net/arm/am79c961a.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,17 @@ am79c961_ramtest(struct net_device *dev, unsigned int val)

static void am79c961_mc_hash(char *addr, u16 *hash)
{
int idx, bit;
u32 crc;
if (addr[0] & 0x01) {
int idx, bit;
u32 crc;

crc = ether_crc_le(ETH_ALEN, addr);
crc = ether_crc_le(ETH_ALEN, addr);

idx = crc >> 30;
bit = (crc >> 26) & 15;
idx = crc >> 30;
bit = (crc >> 26) & 15;

hash[idx] |= 1 << bit;
hash[idx] |= 1 << bit;
}
}

static unsigned int am79c961_get_rx_mode(struct net_device *dev, u16 *hash)
Expand Down
72 changes: 14 additions & 58 deletions trunk/drivers/net/benet/be_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,24 +106,14 @@ static int be_mcc_compl_process(struct be_adapter *adapter,
netdev_stats_update(adapter);
adapter->stats_cmd_sent = false;
}
} else {
if (compl_status == MCC_STATUS_NOT_SUPPORTED ||
compl_status == MCC_STATUS_ILLEGAL_REQUEST)
goto done;

if (compl_status == MCC_STATUS_UNAUTHORIZED_REQUEST) {
dev_warn(&adapter->pdev->dev, "This domain(VM) is not "
"permitted to execute this cmd (opcode %d)\n",
compl->tag0);
} else {
extd_status = (compl->status >> CQE_STATUS_EXTD_SHIFT) &
CQE_STATUS_EXTD_MASK;
dev_err(&adapter->pdev->dev, "Cmd (opcode %d) failed:"
"status %d, extd-status %d\n",
compl->tag0, compl_status, extd_status);
}
} else if ((compl_status != MCC_STATUS_NOT_SUPPORTED) &&
(compl->tag0 != OPCODE_COMMON_NTWK_MAC_QUERY)) {
extd_status = (compl->status >> CQE_STATUS_EXTD_SHIFT) &
CQE_STATUS_EXTD_MASK;
dev_warn(&adapter->pdev->dev,
"Error in cmd completion - opcode %d, compl %d, extd %d\n",
compl->tag0, compl_status, extd_status);
}
done:
return compl_status;
}

Expand Down Expand Up @@ -984,7 +974,7 @@ int be_cmd_txq_create(struct be_adapter *adapter,
return status;
}

/* Uses MCC */
/* Uses mbox */
int be_cmd_rxq_create(struct be_adapter *adapter,
struct be_queue_info *rxq, u16 cq_id, u16 frag_size,
u16 max_frame_size, u32 if_id, u32 rss, u8 *rss_id)
Expand All @@ -994,13 +984,10 @@ int be_cmd_rxq_create(struct be_adapter *adapter,
struct be_dma_mem *q_mem = &rxq->dma_mem;
int status;

spin_lock_bh(&adapter->mcc_lock);
if (mutex_lock_interruptible(&adapter->mbox_lock))
return -1;

wrb = wrb_from_mccq(adapter);
if (!wrb) {
status = -EBUSY;
goto err;
}
wrb = wrb_from_mbox(adapter);
req = embedded_payload(wrb);

be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0,
Expand All @@ -1017,16 +1004,16 @@ int be_cmd_rxq_create(struct be_adapter *adapter,
req->max_frame_size = cpu_to_le16(max_frame_size);
req->rss_queue = cpu_to_le32(rss);

status = be_mcc_notify_wait(adapter);
status = be_mbox_notify_wait(adapter);
if (!status) {
struct be_cmd_resp_eth_rx_create *resp = embedded_payload(wrb);
rxq->id = le16_to_cpu(resp->id);
rxq->created = true;
*rss_id = resp->rss_id;
}

err:
spin_unlock_bh(&adapter->mcc_lock);
mutex_unlock(&adapter->mbox_lock);

return status;
}

Expand Down Expand Up @@ -1081,40 +1068,9 @@ int be_cmd_q_destroy(struct be_adapter *adapter, struct be_queue_info *q,
req->id = cpu_to_le16(q->id);

status = be_mbox_notify_wait(adapter);
if (!status)
q->created = false;

mutex_unlock(&adapter->mbox_lock);
return status;
}

/* Uses MCC */
int be_cmd_rxq_destroy(struct be_adapter *adapter, struct be_queue_info *q)
{
struct be_mcc_wrb *wrb;
struct be_cmd_req_q_destroy *req;
int status;

spin_lock_bh(&adapter->mcc_lock);

wrb = wrb_from_mccq(adapter);
if (!wrb) {
status = -EBUSY;
goto err;
}
req = embedded_payload(wrb);

be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0, OPCODE_ETH_RX_DESTROY);
be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ETH, OPCODE_ETH_RX_DESTROY,
sizeof(*req));
req->id = cpu_to_le16(q->id);

status = be_mcc_notify_wait(adapter);
if (!status)
q->created = false;

err:
spin_unlock_bh(&adapter->mcc_lock);
return status;
}

Expand Down
19 changes: 11 additions & 8 deletions trunk/drivers/net/benet/be_cmds.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,17 @@ struct be_mcc_wrb {

/* Completion Status */
enum {
MCC_STATUS_SUCCESS = 0,
MCC_STATUS_FAILED = 1,
MCC_STATUS_ILLEGAL_REQUEST = 2,
MCC_STATUS_ILLEGAL_FIELD = 3,
MCC_STATUS_INSUFFICIENT_BUFFER = 4,
MCC_STATUS_UNAUTHORIZED_REQUEST = 5,
MCC_STATUS_SUCCESS = 0x0,
/* The client does not have sufficient privileges to execute the command */
MCC_STATUS_INSUFFICIENT_PRIVILEGES = 0x1,
/* A parameter in the command was invalid. */
MCC_STATUS_INVALID_PARAMETER = 0x2,
/* There are insufficient chip resources to execute the command */
MCC_STATUS_INSUFFICIENT_RESOURCES = 0x3,
/* The command is completing because the queue was getting flushed */
MCC_STATUS_QUEUE_FLUSHING = 0x4,
/* The command is completing with a DMA error */
MCC_STATUS_DMA_FAILED = 0x5,
MCC_STATUS_NOT_SUPPORTED = 66
};

Expand Down Expand Up @@ -1482,8 +1487,6 @@ extern int be_cmd_rxq_create(struct be_adapter *adapter,
u32 rss, u8 *rss_id);
extern int be_cmd_q_destroy(struct be_adapter *adapter, struct be_queue_info *q,
int type);
extern int be_cmd_rxq_destroy(struct be_adapter *adapter,
struct be_queue_info *q);
extern int be_cmd_link_status_query(struct be_adapter *adapter,
bool *link_up, u8 *mac_speed, u16 *link_speed, u32 dom);
extern int be_cmd_reset(struct be_adapter *adapter);
Expand Down
111 changes: 37 additions & 74 deletions trunk/drivers/net/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1572,7 +1572,6 @@ static void be_rx_q_clean(struct be_adapter *adapter, struct be_rx_obj *rxo)
memset(page_info, 0, sizeof(*page_info));
}
BUG_ON(atomic_read(&rxq->used));
rxq->tail = rxq->head = 0;
}

static void be_tx_compl_clean(struct be_adapter *adapter,
Expand Down Expand Up @@ -1753,16 +1752,29 @@ static void be_rx_queues_destroy(struct be_adapter *adapter)
int i;

for_all_rx_queues(adapter, rxo, i) {
be_queue_free(adapter, &rxo->q);
q = &rxo->q;
if (q->created) {
be_cmd_q_destroy(adapter, q, QTYPE_RXQ);
/* After the rxq is invalidated, wait for a grace time
* of 1ms for all dma to end and the flush compl to
* arrive
*/
mdelay(1);
be_rx_q_clean(adapter, rxo);
}
be_queue_free(adapter, q);

q = &rxo->cq;
if (q->created)
be_cmd_q_destroy(adapter, q, QTYPE_CQ);
be_queue_free(adapter, q);

/* Clear any residual events */
q = &rxo->rx_eq.q;
if (q->created)
if (q->created) {
be_eq_clean(adapter, &rxo->rx_eq);
be_cmd_q_destroy(adapter, q, QTYPE_EQ);
}
be_queue_free(adapter, q);
}
}
Expand Down Expand Up @@ -1821,14 +1833,30 @@ static int be_rx_queues_create(struct be_adapter *adapter)
rc = be_cmd_cq_create(adapter, cq, eq, false, false, 3);
if (rc)
goto err;

/* Rx Q - will be created in be_open() */
/* Rx Q */
q = &rxo->q;
rc = be_queue_alloc(adapter, q, RX_Q_LEN,
sizeof(struct be_eth_rx_d));
if (rc)
goto err;

rc = be_cmd_rxq_create(adapter, q, cq->id, rx_frag_size,
BE_MAX_JUMBO_FRAME_SIZE, adapter->if_handle,
(i > 0) ? 1 : 0/* rss enable */, &rxo->rss_id);
if (rc)
goto err;
}

if (be_multi_rxq(adapter)) {
u8 rsstable[MAX_RSS_QS];

for_all_rss_queues(adapter, rxo, i)
rsstable[i] = rxo->rss_id;

rc = be_cmd_rss_config(adapter, rsstable,
adapter->num_rx_qs - 1);
if (rc)
goto err;
}

return 0;
Expand Down Expand Up @@ -2274,31 +2302,6 @@ static void be_irq_unregister(struct be_adapter *adapter)
adapter->isr_registered = false;
}

static void be_rx_queues_clear(struct be_adapter *adapter)
{
struct be_queue_info *q;
struct be_rx_obj *rxo;
int i;

for_all_rx_queues(adapter, rxo, i) {
q = &rxo->q;
if (q->created) {
be_cmd_rxq_destroy(adapter, q);
/* After the rxq is invalidated, wait for a grace time
* of 1ms for all dma to end and the flush compl to
* arrive
*/
mdelay(1);
be_rx_q_clean(adapter, rxo);
}

/* Clear any residual events */
q = &rxo->rx_eq.q;
if (q->created)
be_eq_clean(adapter, &rxo->rx_eq);
}
}

static int be_close(struct net_device *netdev)
{
struct be_adapter *adapter = netdev_priv(netdev);
Expand Down Expand Up @@ -2347,40 +2350,6 @@ static int be_close(struct net_device *netdev)
for_all_tx_queues(adapter, txo, i)
be_tx_compl_clean(adapter, txo);

be_rx_queues_clear(adapter);
return 0;
}

static int be_rx_queues_setup(struct be_adapter *adapter)
{
struct be_rx_obj *rxo;
int rc, i;
u8 rsstable[MAX_RSS_QS];

for_all_rx_queues(adapter, rxo, i) {
rc = be_cmd_rxq_create(adapter, &rxo->q, rxo->cq.id,
rx_frag_size, BE_MAX_JUMBO_FRAME_SIZE,
adapter->if_handle,
(i > 0) ? 1 : 0/* rss enable */, &rxo->rss_id);
if (rc)
return rc;
}

if (be_multi_rxq(adapter)) {
for_all_rss_queues(adapter, rxo, i)
rsstable[i] = rxo->rss_id;

rc = be_cmd_rss_config(adapter, rsstable,
adapter->num_rx_qs - 1);
if (rc)
return rc;
}

/* First time posting */
for_all_rx_queues(adapter, rxo, i) {
be_post_rx_frags(rxo, GFP_KERNEL);
napi_enable(&rxo->rx_eq.napi);
}
return 0;
}

Expand All @@ -2394,10 +2363,10 @@ static int be_open(struct net_device *netdev)
u8 mac_speed;
u16 link_speed;

status = be_rx_queues_setup(adapter);
if (status)
goto err;

for_all_rx_queues(adapter, rxo, i) {
be_post_rx_frags(rxo, GFP_KERNEL);
napi_enable(&rxo->rx_eq.napi);
}
napi_enable(&tx_eq->napi);

be_irq_register(adapter);
Expand Down Expand Up @@ -3417,12 +3386,6 @@ static int __devinit be_probe(struct pci_dev *pdev,
if (status)
goto stats_clean;

/* The INTR bit may be set in the card when probed by a kdump kernel
* after a crash.
*/
if (!lancer_chip(adapter))
be_intr_set(adapter, false);

be_msix_enable(adapter);

INIT_DELAYED_WORK(&adapter->work, be_worker);
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/net/can/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ menu "CAN Device Drivers"
config CAN_VCAN
tristate "Virtual Local CAN Interface (vcan)"
depends on CAN
default N
---help---
Similar to the network loopback devices, vcan offers a
virtual local CAN interface.
Expand All @@ -14,6 +15,7 @@ config CAN_VCAN
config CAN_SLCAN
tristate "Serial / USB serial CAN Adaptors (slcan)"
depends on CAN
default N
---help---
CAN driver for several 'low cost' CAN interfaces that are attached
via serial lines or via USB-to-serial adapters using the LAWICEL
Expand Down Expand Up @@ -123,6 +125,7 @@ source "drivers/net/can/softing/Kconfig"
config CAN_DEBUG_DEVICES
bool "CAN devices debugging messages"
depends on CAN
default N
---help---
Say Y here if you want the CAN device drivers to produce a bunch of
debug messages to the system log. Select this if you are having
Expand Down
Loading

0 comments on commit 808dfee

Please sign in to comment.