Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 166704
b: refs/heads/master
c: dcb9b56
h: refs/heads/master
v: v3
  • Loading branch information
Ajit Khaparde authored and David S. Miller committed Oct 1, 2009
1 parent d5d45e5 commit 4dc9c16
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 7 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: 7bfc4ab5620d8169d2effc0dbb644f207f75a9e3
refs/heads/master: dcb9b5648a04d9178f9af9d8b684831a8ea59b9f
1 change: 1 addition & 0 deletions trunk/drivers/net/benet/be.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ struct be_adapter {
bool link_up;
u32 port_num;
bool promiscuous;
u32 cap;
};

extern const struct ethtool_ops be_ethtool_ops;
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/net/benet/be_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ int be_cmd_get_flow_control(struct be_adapter *adapter, u32 *tx_fc, u32 *rx_fc)
}

/* Uses mbox */
int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num)
int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num, u32 *cap)
{
struct be_mcc_wrb *wrb;
struct be_cmd_req_query_fw_cfg *req;
Expand All @@ -1088,6 +1088,7 @@ int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num)
if (!status) {
struct be_cmd_resp_query_fw_cfg *resp = embedded_payload(wrb);
*port_num = le32_to_cpu(resp->phys_port);
*cap = le32_to_cpu(resp->function_cap);
}

spin_unlock(&adapter->mbox_lock);
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/net/benet/be_cmds.h
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,8 @@ extern int be_cmd_set_flow_control(struct be_adapter *adapter,
u32 tx_fc, u32 rx_fc);
extern int be_cmd_get_flow_control(struct be_adapter *adapter,
u32 *tx_fc, u32 *rx_fc);
extern int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num);
extern int be_cmd_query_fw_cfg(struct be_adapter *adapter,
u32 *port_num, u32 *cap);
extern int be_cmd_reset_function(struct be_adapter *adapter);
extern int be_process_mcc(struct be_adapter *adapter);
extern int be_cmd_write_flashrom(struct be_adapter *adapter,
Expand Down
23 changes: 19 additions & 4 deletions trunk/drivers/net/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -747,9 +747,16 @@ static void be_rx_compl_process(struct be_adapter *adapter,
struct be_eth_rx_compl *rxcp)
{
struct sk_buff *skb;
u32 vtp, vid;
u32 vlanf, vid;
u8 vtm;

vtp = AMAP_GET_BITS(struct amap_eth_rx_compl, vtp, rxcp);
vlanf = AMAP_GET_BITS(struct amap_eth_rx_compl, vtp, rxcp);
vtm = AMAP_GET_BITS(struct amap_eth_rx_compl, vtm, rxcp);

/* vlanf could be wrongly set in some cards.
* ignore if vtm is not set */
if ((adapter->cap == 0x400) && !vtm)
vlanf = 0;

skb = netdev_alloc_skb(adapter->netdev, BE_HDR_LEN + NET_IP_ALIGN);
if (!skb) {
Expand All @@ -772,7 +779,7 @@ static void be_rx_compl_process(struct be_adapter *adapter,
skb->protocol = eth_type_trans(skb, adapter->netdev);
skb->dev = adapter->netdev;

if (vtp) {
if (vlanf) {
if (!adapter->vlan_grp || adapter->num_vlans == 0) {
kfree_skb(skb);
return;
Expand All @@ -797,11 +804,18 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter,
struct be_eq_obj *eq_obj = &adapter->rx_eq;
u32 num_rcvd, pkt_size, remaining, vlanf, curr_frag_len;
u16 i, rxq_idx = 0, vid, j;
u8 vtm;

num_rcvd = AMAP_GET_BITS(struct amap_eth_rx_compl, numfrags, rxcp);
pkt_size = AMAP_GET_BITS(struct amap_eth_rx_compl, pktsize, rxcp);
vlanf = AMAP_GET_BITS(struct amap_eth_rx_compl, vtp, rxcp);
rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp);
vtm = AMAP_GET_BITS(struct amap_eth_rx_compl, vtm, rxcp);

/* vlanf could be wrongly set in some cards.
* ignore if vtm is not set */
if ((adapter->cap == 0x400) && !vtm)
vlanf = 0;

skb = napi_get_frags(&eq_obj->napi);
if (!skb) {
Expand Down Expand Up @@ -2045,7 +2059,8 @@ static int be_hw_up(struct be_adapter *adapter)
if (status)
return status;

status = be_cmd_query_fw_cfg(adapter, &adapter->port_num);
status = be_cmd_query_fw_cfg(adapter,
&adapter->port_num, &adapter->cap);
return status;
}

Expand Down

0 comments on commit 4dc9c16

Please sign in to comment.