/* * 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. */ #ifndef _CXGB3_OFFLOAD_H #define _CXGB3_OFFLOAD_H #include <linux/list.h> #include <linux/skbuff.h> #include "l2t.h" #include "t3cdev.h" #include "t3_cpl.h" struct adapter; void cxgb3_offload_init(void); void cxgb3_adapter_ofld(struct adapter *adapter); void cxgb3_adapter_unofld(struct adapter *adapter); int cxgb3_offload_activate(struct adapter *adapter); void cxgb3_offload_deactivate(struct adapter *adapter); void cxgb3_set_dummy_ops(struct t3cdev *dev); struct t3cdev *dev2t3cdev(struct net_device *dev); /* * Client registration. Users of T3 driver must register themselves. * The T3 driver will call the add function of every client for each T3 * adapter activated, passing up the t3cdev ptr. Each client fills out an * array of callback functions to process CPL messages. */ void cxgb3_register_client(struct cxgb3_client *client); void cxgb3_unregister_client(struct cxgb3_client *client); void cxgb3_add_clients(struct t3cdev *tdev); void cxgb3_remove_clients(struct t3cdev *tdev); void cxgb3_event_notify(struct t3cdev *tdev, u32 event, u32 port); cxgb3_cpl_handler_func; enum { … }; struct cxgb3_client { … }; /* * TID allocation services. */ int cxgb3_alloc_atid(struct t3cdev *dev, struct cxgb3_client *client, void *ctx); int cxgb3_alloc_stid(struct t3cdev *dev, struct cxgb3_client *client, void *ctx); void *cxgb3_free_atid(struct t3cdev *dev, int atid); void cxgb3_free_stid(struct t3cdev *dev, int stid); void cxgb3_insert_tid(struct t3cdev *dev, struct cxgb3_client *client, void *ctx, unsigned int tid); void cxgb3_queue_tid_release(struct t3cdev *dev, unsigned int tid); void cxgb3_remove_tid(struct t3cdev *dev, void *ctx, unsigned int tid); struct t3c_tid_entry { … }; /* CPL message priority levels */ enum { … }; /* Flags for return value of CPL message handlers */ enum { … }; cpl_handler_func; /* * Returns a pointer to the first byte of the CPL header in an sk_buff that * contains a CPL message. */ static inline void *cplhdr(struct sk_buff *skb) { … } void t3_register_cpl_handler(unsigned int opcode, cpl_handler_func h); listen_entry; active_open_entry; /* * Holds the size, base address, free list start, etc of the TID, server TID, * and active-open TID tables for a offload device. * The tables themselves are allocated dynamically. */ struct tid_info { … }; struct t3c_data { … }; /* * t3cdev -> t3c_data accessor */ #define T3C_DATA(dev) … #endif