Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132551
b: refs/heads/master
c: f3f9258
h: refs/heads/master
i:
  132549: 90ffc72
  132547: 8795463
  132543: 14a3e09
v: v3
  • Loading branch information
Jouni Malinen authored and John W. Linville committed Mar 20, 2009
1 parent 69aaa94 commit bbf240f
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 40 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: 5ed0102fbf36f58091089907213b4bd191ca2e0c
refs/heads/master: f3f9258678b081c3ef2f036aef450cd2053ef419
1 change: 0 additions & 1 deletion trunk/drivers/net/benet/be.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ struct be_adapter {
struct be_eq_obj rx_eq;
struct be_rx_obj rx_obj;
u32 big_page_size; /* Compounded page size shared by rx wrbs */
bool rx_post_starved; /* Zero rx frags have been posted to BE */

struct vlan_group *vlan_grp;
u16 num_vlans;
Expand Down
60 changes: 26 additions & 34 deletions trunk/drivers/net/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,26 @@ static void be_rx_eqd_update(struct be_adapter *adapter)
rx_eq->cur_eqd = eqd;
}

static void be_worker(struct work_struct *work)
{
struct be_adapter *adapter =
container_of(work, struct be_adapter, work.work);
int status;

/* Check link */
be_link_status_update(adapter);

/* Get Stats */
status = be_cmd_get_stats(&adapter->ctrl, &adapter->stats.cmd);
if (!status)
netdev_stats_update(adapter);

/* Set EQ delay */
be_rx_eqd_update(adapter);

schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000));
}

static struct net_device_stats *be_get_stats(struct net_device *dev)
{
struct be_adapter *adapter = netdev_priv(dev);
Expand Down Expand Up @@ -473,7 +493,7 @@ static int be_change_mtu(struct net_device *netdev, int new_mtu)
* program them in BE. If more than BE_NUM_VLANS_SUPPORTED are configured,
* set the BE in promiscuous VLAN mode.
*/
static void be_vid_config(struct net_device *netdev)
static void be_vids_config(struct net_device *netdev)
{
struct be_adapter *adapter = netdev_priv(netdev);
u16 vtag[BE_NUM_VLANS_SUPPORTED];
Expand Down Expand Up @@ -516,7 +536,7 @@ static void be_vlan_add_vid(struct net_device *netdev, u16 vid)
adapter->num_vlans++;
adapter->vlan_tag[vid] = 1;

be_vid_config(netdev);
be_vids_config(netdev);
}

static void be_vlan_rem_vid(struct net_device *netdev, u16 vid)
Expand All @@ -527,7 +547,7 @@ static void be_vlan_rem_vid(struct net_device *netdev, u16 vid)
adapter->vlan_tag[vid] = 0;

vlan_group_set_device(adapter->vlan_grp, vid, NULL);
be_vid_config(netdev);
be_vids_config(netdev);
}

static void be_set_multicast_filter(struct net_device *netdev)
Expand Down Expand Up @@ -880,11 +900,8 @@ static void be_post_rx_frags(struct be_adapter *adapter)
page_info->last_page_user = true;

if (posted) {
atomic_add(posted, &rxq->used);
be_rxq_notify(&adapter->ctrl, rxq->id, posted);
} else if (atomic_read(&rxq->used) == 0) {
/* Let be_worker replenish when memory is available */
adapter->rx_post_starved = true;
atomic_add(posted, &rxq->used);
}

return;
Expand Down Expand Up @@ -1288,31 +1305,6 @@ int be_poll_tx(struct napi_struct *napi, int budget)
return 1;
}

static void be_worker(struct work_struct *work)
{
struct be_adapter *adapter =
container_of(work, struct be_adapter, work.work);
int status;

/* Check link */
be_link_status_update(adapter);

/* Get Stats */
status = be_cmd_get_stats(&adapter->ctrl, &adapter->stats.cmd);
if (!status)
netdev_stats_update(adapter);

/* Set EQ delay */
be_rx_eqd_update(adapter);

if (adapter->rx_post_starved) {
adapter->rx_post_starved = false;
be_post_rx_frags(adapter);
}

schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000));
}

static void be_msix_enable(struct be_adapter *adapter)
{
int i, status;
Expand Down Expand Up @@ -1430,8 +1422,6 @@ static int be_open(struct net_device *netdev)
if (status != 0)
goto do_none;

be_vid_config(netdev);

status = be_cmd_set_flow_control(ctrl, true, true);
if (status != 0)
goto if_destroy;
Expand Down Expand Up @@ -1866,6 +1856,8 @@ static int be_resume(struct pci_dev *pdev)
pci_set_power_state(pdev, 0);
pci_restore_state(pdev);

be_vids_config(netdev);

if (netif_running(netdev)) {
rtnl_lock();
be_open(netdev);
Expand Down
9 changes: 5 additions & 4 deletions trunk/drivers/net/sungem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2998,11 +2998,8 @@ static const struct net_device_ops gem_netdev_ops = {
.ndo_do_ioctl = gem_ioctl,
.ndo_tx_timeout = gem_tx_timeout,
.ndo_change_mtu = gem_change_mtu,
.ndo_set_mac_address = eth_mac_addr,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = gem_set_mac_address,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = gem_poll_controller,
#endif
};

static int __devinit gem_init_one(struct pci_dev *pdev,
Expand Down Expand Up @@ -3164,6 +3161,10 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
dev->watchdog_timeo = 5 * HZ;
dev->irq = pdev->irq;
dev->dma = 0;
dev->set_mac_address = gem_set_mac_address;
#ifdef CONFIG_NET_POLL_CONTROLLER
dev->poll_controller = gem_poll_controller;
#endif

/* Set that now, in case PM kicks in now */
pci_set_drvdata(pdev, dev);
Expand Down
11 changes: 11 additions & 0 deletions trunk/net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1908,6 +1908,11 @@ static int nl80211_get_mesh_params(struct sk_buff *skb,
if (err)
return err;

if (!drv->ops->get_mesh_params) {
err = -EOPNOTSUPP;
goto out;
}

/* Get the mesh params */
rtnl_lock();
err = drv->ops->get_mesh_params(&drv->wiphy, dev, &cur_params);
Expand Down Expand Up @@ -2017,6 +2022,11 @@ static int nl80211_set_mesh_params(struct sk_buff *skb, struct genl_info *info)
if (err)
return err;

if (!drv->ops->set_mesh_params) {
err = -EOPNOTSUPP;
goto out;
}

/* This makes sure that there aren't more than 32 mesh config
* parameters (otherwise our bitfield scheme would not work.) */
BUILD_BUG_ON(NL80211_MESHCONF_ATTR_MAX > 32);
Expand Down Expand Up @@ -2061,6 +2071,7 @@ static int nl80211_set_mesh_params(struct sk_buff *skb, struct genl_info *info)
err = drv->ops->set_mesh_params(&drv->wiphy, dev, &cfg, mask);
rtnl_unlock();

out:
/* cleanup */
cfg80211_put_dev(drv);
dev_put(dev);
Expand Down

0 comments on commit bbf240f

Please sign in to comment.