diff options
author | Jiri Pirko <jpirko@redhat.com> | 2011-12-08 19:52:37 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-08 19:52:37 -0500 |
commit | 8e586137e6b63af1e881b328466ab5ffbe562510 (patch) | |
tree | da0767e1b1361aa24bd32f485453079e31854c0c /drivers/net/ethernet/ibm | |
parent | 7da82c06ded105bf601bfa0eafc92e84eb0ceeed (diff) |
net: make vlan ndo_vlan_rx_[add/kill]_vid return error value
Let caller know the result of adding/removing vlan id to/from vlan
filter.
In some drivers I make those functions to just return 0. But in those
where there is able to see if hw setup went correctly, return value is
set appropriately.
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ibm')
-rw-r--r-- | drivers/net/ethernet/ibm/ehea/ehea_main.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c index bfeccbfde236..3554414eb5e2 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea_main.c +++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c | |||
@@ -2114,17 +2114,19 @@ static int ehea_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2114 | return NETDEV_TX_OK; | 2114 | return NETDEV_TX_OK; |
2115 | } | 2115 | } |
2116 | 2116 | ||
2117 | static void ehea_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) | 2117 | static int ehea_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) |
2118 | { | 2118 | { |
2119 | struct ehea_port *port = netdev_priv(dev); | 2119 | struct ehea_port *port = netdev_priv(dev); |
2120 | struct ehea_adapter *adapter = port->adapter; | 2120 | struct ehea_adapter *adapter = port->adapter; |
2121 | struct hcp_ehea_port_cb1 *cb1; | 2121 | struct hcp_ehea_port_cb1 *cb1; |
2122 | int index; | 2122 | int index; |
2123 | u64 hret; | 2123 | u64 hret; |
2124 | int err = 0; | ||
2124 | 2125 | ||
2125 | cb1 = (void *)get_zeroed_page(GFP_KERNEL); | 2126 | cb1 = (void *)get_zeroed_page(GFP_KERNEL); |
2126 | if (!cb1) { | 2127 | if (!cb1) { |
2127 | pr_err("no mem for cb1\n"); | 2128 | pr_err("no mem for cb1\n"); |
2129 | err = -ENOMEM; | ||
2128 | goto out; | 2130 | goto out; |
2129 | } | 2131 | } |
2130 | 2132 | ||
@@ -2132,6 +2134,7 @@ static void ehea_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) | |||
2132 | H_PORT_CB1, H_PORT_CB1_ALL, cb1); | 2134 | H_PORT_CB1, H_PORT_CB1_ALL, cb1); |
2133 | if (hret != H_SUCCESS) { | 2135 | if (hret != H_SUCCESS) { |
2134 | pr_err("query_ehea_port failed\n"); | 2136 | pr_err("query_ehea_port failed\n"); |
2137 | err = -EINVAL; | ||
2135 | goto out; | 2138 | goto out; |
2136 | } | 2139 | } |
2137 | 2140 | ||
@@ -2140,24 +2143,28 @@ static void ehea_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) | |||
2140 | 2143 | ||
2141 | hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id, | 2144 | hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id, |
2142 | H_PORT_CB1, H_PORT_CB1_ALL, cb1); | 2145 | H_PORT_CB1, H_PORT_CB1_ALL, cb1); |
2143 | if (hret != H_SUCCESS) | 2146 | if (hret != H_SUCCESS) { |
2144 | pr_err("modify_ehea_port failed\n"); | 2147 | pr_err("modify_ehea_port failed\n"); |
2148 | err = -EINVAL; | ||
2149 | } | ||
2145 | out: | 2150 | out: |
2146 | free_page((unsigned long)cb1); | 2151 | free_page((unsigned long)cb1); |
2147 | return; | 2152 | return err; |
2148 | } | 2153 | } |
2149 | 2154 | ||
2150 | static void ehea_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | 2155 | static int ehea_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) |
2151 | { | 2156 | { |
2152 | struct ehea_port *port = netdev_priv(dev); | 2157 | struct ehea_port *port = netdev_priv(dev); |
2153 | struct ehea_adapter *adapter = port->adapter; | 2158 | struct ehea_adapter *adapter = port->adapter; |
2154 | struct hcp_ehea_port_cb1 *cb1; | 2159 | struct hcp_ehea_port_cb1 *cb1; |
2155 | int index; | 2160 | int index; |
2156 | u64 hret; | 2161 | u64 hret; |
2162 | int err = 0; | ||
2157 | 2163 | ||
2158 | cb1 = (void *)get_zeroed_page(GFP_KERNEL); | 2164 | cb1 = (void *)get_zeroed_page(GFP_KERNEL); |
2159 | if (!cb1) { | 2165 | if (!cb1) { |
2160 | pr_err("no mem for cb1\n"); | 2166 | pr_err("no mem for cb1\n"); |
2167 | err = -ENOMEM; | ||
2161 | goto out; | 2168 | goto out; |
2162 | } | 2169 | } |
2163 | 2170 | ||
@@ -2165,6 +2172,7 @@ static void ehea_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
2165 | H_PORT_CB1, H_PORT_CB1_ALL, cb1); | 2172 | H_PORT_CB1, H_PORT_CB1_ALL, cb1); |
2166 | if (hret != H_SUCCESS) { | 2173 | if (hret != H_SUCCESS) { |
2167 | pr_err("query_ehea_port failed\n"); | 2174 | pr_err("query_ehea_port failed\n"); |
2175 | err = -EINVAL; | ||
2168 | goto out; | 2176 | goto out; |
2169 | } | 2177 | } |
2170 | 2178 | ||
@@ -2173,10 +2181,13 @@ static void ehea_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
2173 | 2181 | ||
2174 | hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id, | 2182 | hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id, |
2175 | H_PORT_CB1, H_PORT_CB1_ALL, cb1); | 2183 | H_PORT_CB1, H_PORT_CB1_ALL, cb1); |
2176 | if (hret != H_SUCCESS) | 2184 | if (hret != H_SUCCESS) { |
2177 | pr_err("modify_ehea_port failed\n"); | 2185 | pr_err("modify_ehea_port failed\n"); |
2186 | err = -EINVAL; | ||
2187 | } | ||
2178 | out: | 2188 | out: |
2179 | free_page((unsigned long)cb1); | 2189 | free_page((unsigned long)cb1); |
2190 | return err; | ||
2180 | } | 2191 | } |
2181 | 2192 | ||
2182 | int ehea_activate_qp(struct ehea_adapter *adapter, struct ehea_qp *qp) | 2193 | int ehea_activate_qp(struct ehea_adapter *adapter, struct ehea_qp *qp) |