aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cxgb4/cxgb4_main.c
diff options
context:
space:
mode:
authorstephen hemminger <shemminger@vyatta.com>2010-10-18 01:39:18 -0400
committerDavid S. Miller <davem@davemloft.net>2010-10-21 07:25:49 -0400
commit31b9c19bfe32bed7fdf80cd0b1aa9d0f0569844a (patch)
tree47ffbb9e16062bf88e713f0332f4e0e4e2c887a7 /drivers/net/cxgb4/cxgb4_main.c
parentb003f4e171304234eae9cc11c9fd7f1cbaaf0d6b (diff)
cxgb4: function namespace cleanup (v3)
Make functions only used in one file local. Remove lots of dead code, relating to unsupported functions in mainline driver like RSS, IPv6, and TCP offload. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Acked-by: Dimitris Michailidis <dm@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cxgb4/cxgb4_main.c')
-rw-r--r--drivers/net/cxgb4/cxgb4_main.c68
1 files changed, 3 insertions, 65 deletions
diff --git a/drivers/net/cxgb4/cxgb4_main.c b/drivers/net/cxgb4/cxgb4_main.c
index 22169a73b7f7..930bd075a43e 100644
--- a/drivers/net/cxgb4/cxgb4_main.c
+++ b/drivers/net/cxgb4/cxgb4_main.c
@@ -880,7 +880,7 @@ void *t4_alloc_mem(size_t size)
880/* 880/*
881 * Free memory allocated through alloc_mem(). 881 * Free memory allocated through alloc_mem().
882 */ 882 */
883void t4_free_mem(void *addr) 883static void t4_free_mem(void *addr)
884{ 884{
885 if (is_vmalloc_addr(addr)) 885 if (is_vmalloc_addr(addr))
886 vfree(addr); 886 vfree(addr);
@@ -2206,8 +2206,8 @@ static void mk_tid_release(struct sk_buff *skb, unsigned int chan,
2206 * Queue a TID release request and if necessary schedule a work queue to 2206 * Queue a TID release request and if necessary schedule a work queue to
2207 * process it. 2207 * process it.
2208 */ 2208 */
2209void cxgb4_queue_tid_release(struct tid_info *t, unsigned int chan, 2209static void cxgb4_queue_tid_release(struct tid_info *t, unsigned int chan,
2210 unsigned int tid) 2210 unsigned int tid)
2211{ 2211{
2212 void **p = &t->tid_tab[tid]; 2212 void **p = &t->tid_tab[tid];
2213 struct adapter *adap = container_of(t, struct adapter, tids); 2213 struct adapter *adap = container_of(t, struct adapter, tids);
@@ -2222,7 +2222,6 @@ void cxgb4_queue_tid_release(struct tid_info *t, unsigned int chan,
2222 } 2222 }
2223 spin_unlock_bh(&adap->tid_release_lock); 2223 spin_unlock_bh(&adap->tid_release_lock);
2224} 2224}
2225EXPORT_SYMBOL(cxgb4_queue_tid_release);
2226 2225
2227/* 2226/*
2228 * Process the list of pending TID release requests. 2227 * Process the list of pending TID release requests.
@@ -2355,48 +2354,6 @@ int cxgb4_create_server(const struct net_device *dev, unsigned int stid,
2355EXPORT_SYMBOL(cxgb4_create_server); 2354EXPORT_SYMBOL(cxgb4_create_server);
2356 2355
2357/** 2356/**
2358 * cxgb4_create_server6 - create an IPv6 server
2359 * @dev: the device
2360 * @stid: the server TID
2361 * @sip: local IPv6 address to bind server to
2362 * @sport: the server's TCP port
2363 * @queue: queue to direct messages from this server to
2364 *
2365 * Create an IPv6 server for the given port and address.
2366 * Returns <0 on error and one of the %NET_XMIT_* values on success.
2367 */
2368int cxgb4_create_server6(const struct net_device *dev, unsigned int stid,
2369 const struct in6_addr *sip, __be16 sport,
2370 unsigned int queue)
2371{
2372 unsigned int chan;
2373 struct sk_buff *skb;
2374 struct adapter *adap;
2375 struct cpl_pass_open_req6 *req;
2376
2377 skb = alloc_skb(sizeof(*req), GFP_KERNEL);
2378 if (!skb)
2379 return -ENOMEM;
2380
2381 adap = netdev2adap(dev);
2382 req = (struct cpl_pass_open_req6 *)__skb_put(skb, sizeof(*req));
2383 INIT_TP_WR(req, 0);
2384 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_PASS_OPEN_REQ6, stid));
2385 req->local_port = sport;
2386 req->peer_port = htons(0);
2387 req->local_ip_hi = *(__be64 *)(sip->s6_addr);
2388 req->local_ip_lo = *(__be64 *)(sip->s6_addr + 8);
2389 req->peer_ip_hi = cpu_to_be64(0);
2390 req->peer_ip_lo = cpu_to_be64(0);
2391 chan = rxq_to_chan(&adap->sge, queue);
2392 req->opt0 = cpu_to_be64(TX_CHAN(chan));
2393 req->opt1 = cpu_to_be64(CONN_POLICY_ASK |
2394 SYN_RSS_ENABLE | SYN_RSS_QUEUE(queue));
2395 return t4_mgmt_tx(adap, skb);
2396}
2397EXPORT_SYMBOL(cxgb4_create_server6);
2398
2399/**
2400 * cxgb4_best_mtu - find the entry in the MTU table closest to an MTU 2357 * cxgb4_best_mtu - find the entry in the MTU table closest to an MTU
2401 * @mtus: the HW MTU table 2358 * @mtus: the HW MTU table
2402 * @mtu: the target MTU 2359 * @mtu: the target MTU
@@ -2455,25 +2412,6 @@ unsigned int cxgb4_port_idx(const struct net_device *dev)
2455} 2412}
2456EXPORT_SYMBOL(cxgb4_port_idx); 2413EXPORT_SYMBOL(cxgb4_port_idx);
2457 2414
2458/**
2459 * cxgb4_netdev_by_hwid - return the net device of a HW port
2460 * @pdev: identifies the adapter
2461 * @id: the HW port id
2462 *
2463 * Return the net device associated with the interface with the given HW
2464 * id.
2465 */
2466struct net_device *cxgb4_netdev_by_hwid(struct pci_dev *pdev, unsigned int id)
2467{
2468 const struct adapter *adap = pci_get_drvdata(pdev);
2469
2470 if (!adap || id >= NCHAN)
2471 return NULL;
2472 id = adap->chan_map[id];
2473 return id < MAX_NPORTS ? adap->port[id] : NULL;
2474}
2475EXPORT_SYMBOL(cxgb4_netdev_by_hwid);
2476
2477void cxgb4_get_tcp_stats(struct pci_dev *pdev, struct tp_tcp_stats *v4, 2415void cxgb4_get_tcp_stats(struct pci_dev *pdev, struct tp_tcp_stats *v4,
2478 struct tp_tcp_stats *v6) 2416 struct tp_tcp_stats *v6)
2479{ 2417{