linux/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c

/*
 * Copyright (c) 2006-2008 Chelsio, Inc. All rights reserved.
 *
 * This software is available to you under a choice of one of two
 * licenses.  You may choose to be licensed under the terms of the GNU
 * General Public License (GPL) Version 2, available from the file
 * COPYING in the main directory of this source tree, or the
 * OpenIB.org BSD license below:
 *
 *     Redistribution and use in source and binary forms, with or
 *     without modification, are permitted provided that the following
 *     conditions are met:
 *
 *      - Redistributions of source code must retain the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer.
 *
 *      - Redistributions in binary form must reproduce the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer in the documentation and/or other materials
 *        provided with the distribution.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

#define pr_fmt(fmt)

#include <linux/list.h>
#include <linux/slab.h>
#include <net/neighbour.h>
#include <linux/notifier.h>
#include <linux/atomic.h>
#include <linux/proc_fs.h>
#include <linux/if_vlan.h>
#include <net/netevent.h>
#include <linux/highmem.h>
#include <linux/vmalloc.h>
#include <linux/export.h>

#include "common.h"
#include "regs.h"
#include "cxgb3_ioctl.h"
#include "cxgb3_ctl_defs.h"
#include "cxgb3_defs.h"
#include "l2t.h"
#include "firmware_exports.h"
#include "cxgb3_offload.h"

static LIST_HEAD(client_list);
static LIST_HEAD(ofld_dev_list);
static DEFINE_MUTEX(cxgb3_db_lock);

static DEFINE_RWLOCK(adapter_list_lock);
static LIST_HEAD(adapter_list);

static const unsigned int MAX_ATIDS =;
static const unsigned int ATID_BASE =;

static void cxgb_neigh_update(struct neighbour *neigh);
static void cxgb_redirect(struct dst_entry *old, struct dst_entry *new,
			  struct neighbour *neigh, const void *daddr);

static inline int offload_activated(struct t3cdev *tdev)
{}

/**
 *	cxgb3_register_client - register an offload client
 *	@client: the client
 *
 *	Add the client to the client list,
 *	and call backs the client for each activated offload device
 */
void cxgb3_register_client(struct cxgb3_client *client)
{}

EXPORT_SYMBOL();

/**
 *	cxgb3_unregister_client - unregister an offload client
 *	@client: the client
 *
 *	Remove the client to the client list,
 *	and call backs the client for each activated offload device.
 */
void cxgb3_unregister_client(struct cxgb3_client *client)
{}

EXPORT_SYMBOL();

/**
 *	cxgb3_add_clients - activate registered clients for an offload device
 *	@tdev: the offload device
 *
 *	Call backs all registered clients once a offload device is activated
 */
void cxgb3_add_clients(struct t3cdev *tdev)
{}

/**
 *	cxgb3_remove_clients - deactivates registered clients
 *			       for an offload device
 *	@tdev: the offload device
 *
 *	Call backs all registered clients once a offload device is deactivated
 */
void cxgb3_remove_clients(struct t3cdev *tdev)
{}

void cxgb3_event_notify(struct t3cdev *tdev, u32 event, u32 port)
{}

static struct net_device *get_iff_from_mac(struct adapter *adapter,
					   const unsigned char *mac,
					   unsigned int vlan)
{}

static int cxgb_ulp_iscsi_ctl(struct adapter *adapter, unsigned int req,
			      void *data)
{}

/* Response queue used for RDMA events. */
#define ASYNC_NOTIF_RSPQ

static int cxgb_rdma_ctl(struct adapter *adapter, unsigned int req, void *data)
{}

static int cxgb_offload_ctl(struct t3cdev *tdev, unsigned int req, void *data)
{}

/*
 * Dummy handler for Rx offload packets in case we get an offload packet before
 * proper processing is setup.  This complains and drops the packet as it isn't
 * normal to get offload packets at this stage.
 */
static int rx_offload_blackhole(struct t3cdev *dev, struct sk_buff **skbs,
				int n)
{}

static void dummy_neigh_update(struct t3cdev *dev, struct neighbour *neigh)
{}

void cxgb3_set_dummy_ops(struct t3cdev *dev)
{}

/*
 * Free an active-open TID.
 */
void *cxgb3_free_atid(struct t3cdev *tdev, int atid)
{}

EXPORT_SYMBOL();

/*
 * Free a server TID and return it to the free pool.
 */
void cxgb3_free_stid(struct t3cdev *tdev, int stid)
{}

EXPORT_SYMBOL();

void cxgb3_insert_tid(struct t3cdev *tdev, struct cxgb3_client *client,
		      void *ctx, unsigned int tid)
{}

EXPORT_SYMBOL();

/*
 * Populate a TID_RELEASE WR.  The skb must be already propely sized.
 */
static inline void mk_tid_release(struct sk_buff *skb, unsigned int tid)
{}

static void t3_process_tid_release_list(struct work_struct *work)
{}

/* use ctx as a next pointer in the tid release list */
void cxgb3_queue_tid_release(struct t3cdev *tdev, unsigned int tid)
{}

EXPORT_SYMBOL();

/*
 * Remove a tid from the TID table.  A client may defer processing its last
 * CPL message if it is locked at the time it arrives, and while the message
 * sits in the client's backlog the TID may be reused for another connection.
 * To handle this we atomically switch the TID association if it still points
 * to the original client context.
 */
void cxgb3_remove_tid(struct t3cdev *tdev, void *ctx, unsigned int tid)
{}

EXPORT_SYMBOL();

int cxgb3_alloc_atid(struct t3cdev *tdev, struct cxgb3_client *client,
		     void *ctx)
{}

EXPORT_SYMBOL();

int cxgb3_alloc_stid(struct t3cdev *tdev, struct cxgb3_client *client,
		     void *ctx)
{}

EXPORT_SYMBOL();

/* Get the t3cdev associated with a net_device */
struct t3cdev *dev2t3cdev(struct net_device *dev)
{}

EXPORT_SYMBOL();

static int do_smt_write_rpl(struct t3cdev *dev, struct sk_buff *skb)
{}

static int do_l2t_write_rpl(struct t3cdev *dev, struct sk_buff *skb)
{}

static int do_rte_write_rpl(struct t3cdev *dev, struct sk_buff *skb)
{}

static int do_act_open_rpl(struct t3cdev *dev, struct sk_buff *skb)
{}

static int do_stid_rpl(struct t3cdev *dev, struct sk_buff *skb)
{}

static int do_hwtid_rpl(struct t3cdev *dev, struct sk_buff *skb)
{}

static int do_cr(struct t3cdev *dev, struct sk_buff *skb)
{}

/*
 * Returns an sk_buff for a reply CPL message of size len.  If the input
 * sk_buff has no other users it is trimmed and reused, otherwise a new buffer
 * is allocated.  The input skb must be of size at least len.  Note that this
 * operation does not destroy the original skb data even if it decides to reuse
 * the buffer.
 */
static struct sk_buff *cxgb3_get_cpl_reply_skb(struct sk_buff *skb, size_t len,
					       gfp_t gfp)
{}

static int do_abort_req_rss(struct t3cdev *dev, struct sk_buff *skb)
{}

static int do_act_establish(struct t3cdev *dev, struct sk_buff *skb)
{}

static int do_trace(struct t3cdev *dev, struct sk_buff *skb)
{}

/*
 * That skb would better have come from process_responses() where we abuse
 * ->priority and ->csum to carry our data.  NB: if we get to per-arch
 * ->csum, the things might get really interesting here.
 */

static inline u32 get_hwtid(struct sk_buff *skb)
{}

static inline u32 get_opcode(struct sk_buff *skb)
{}

static int do_term(struct t3cdev *dev, struct sk_buff *skb)
{}

static int nb_callback(struct notifier_block *self, unsigned long event,
		       void *ctx)
{}

static struct notifier_block nb =;

/*
 * Process a received packet with an unknown/unexpected CPL opcode.
 */
static int do_bad_cpl(struct t3cdev *dev, struct sk_buff *skb)
{}

/*
 * Handlers for each CPL opcode
 */
static cpl_handler_func cpl_handlers[NUM_CPL_CMDS];

/*
 * Add a new handler to the CPL dispatch table.  A NULL handler may be supplied
 * to unregister an existing handler.
 */
void t3_register_cpl_handler(unsigned int opcode, cpl_handler_func h)
{}

EXPORT_SYMBOL();

/*
 * T3CDEV's receive method.
 */
static int process_rx(struct t3cdev *dev, struct sk_buff **skbs, int n)
{}

/*
 * Sends an sk_buff to a T3C driver after dealing with any active network taps.
 */
int cxgb3_ofld_send(struct t3cdev *dev, struct sk_buff *skb)
{}

EXPORT_SYMBOL();

static int is_offloading(struct net_device *dev)
{}

static void cxgb_neigh_update(struct neighbour *neigh)
{}

static void set_l2t_ix(struct t3cdev *tdev, u32 tid, struct l2t_entry *e)
{}

static void cxgb_redirect(struct dst_entry *old, struct dst_entry *new,
			  struct neighbour *neigh,
			  const void *daddr)
{}

/*
 * Allocate and initialize the TID tables.  Returns 0 on success.
 */
static int init_tid_tabs(struct tid_info *t, unsigned int ntids,
			 unsigned int natids, unsigned int nstids,
			 unsigned int atid_base, unsigned int stid_base)
{}

static void free_tid_maps(struct tid_info *t)
{}

static inline void add_adapter(struct adapter *adap)
{}

static inline void remove_adapter(struct adapter *adap)
{}

int cxgb3_offload_activate(struct adapter *adapter)
{}

static void clean_l2_data(struct rcu_head *head)
{}


void cxgb3_offload_deactivate(struct adapter *adapter)
{}

static inline void register_tdev(struct t3cdev *tdev)
{}

static inline void unregister_tdev(struct t3cdev *tdev)
{}

static inline int adap2type(struct adapter *adapter)
{}

void cxgb3_adapter_ofld(struct adapter *adapter)
{}

void cxgb3_adapter_unofld(struct adapter *adapter)
{}

void __init cxgb3_offload_init(void)
{}