- supported.conf: Added sparse_keymap (eeepc_laptop depends on it)
[linux-flexiantxendom0-3.2.10.git] / drivers / net / sfc / sfc_resource / ci / efhw / falcon.h
1 /****************************************************************************
2  * Driver for Solarflare network controllers -
3  *          resource management for Xen backend, OpenOnload, etc
4  *           (including support for SFE4001 10GBT NIC)
5  *
6  * This file contains API provided by efhw/falcon.c file.  This file is not
7  * designed for use outside of the SFC resource driver.
8  *
9  * Copyright 2005-2007: Solarflare Communications Inc,
10  *                      9501 Jeronimo Road, Suite 250,
11  *                      Irvine, CA 92618, USA
12  *
13  * Developed and maintained by Solarflare Communications:
14  *                      <linux-xen-drivers@solarflare.com>
15  *                      <onload-dev@solarflare.com>
16  *
17  * Certain parts of the driver were implemented by
18  *          Alexandra Kossovsky <Alexandra.Kossovsky@oktetlabs.ru>
19  *          OKTET Labs Ltd, Russia,
20  *          http://oktetlabs.ru, <info@oktetlabs.ru>
21  *          by request of Solarflare Communications
22  *
23  *
24  * This program is free software; you can redistribute it and/or modify it
25  * under the terms of the GNU General Public License version 2 as published
26  * by the Free Software Foundation, incorporated herein by reference.
27  *
28  * This program is distributed in the hope that it will be useful,
29  * but WITHOUT ANY WARRANTY; without even the implied warranty of
30  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
31  * GNU General Public License for more details.
32  *
33  * You should have received a copy of the GNU General Public License
34  * along with this program; if not, write to the Free Software
35  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
36  ****************************************************************************
37  */
38
39 #ifndef __CI_EFHW_FALCON_H__
40 #define __CI_EFHW_FALCON_H__
41
42 #include <ci/efhw/efhw_types.h>
43 #include <ci/efhw/common.h>
44
45 /*----------------------------------------------------------------------------
46  *
47  * Locks - unfortunately required
48  *
49  *---------------------------------------------------------------------------*/
50
51 #define FALCON_LOCK_DECL        irq_flags_t lock_state
52 #define FALCON_LOCK_LOCK(nic) \
53         spin_lock_irqsave((nic)->reg_lock, lock_state)
54 #define FALCON_LOCK_UNLOCK(nic) \
55         spin_unlock_irqrestore((nic)->reg_lock, lock_state)
56
57 extern struct efhw_func_ops falcon_char_functional_units;
58
59 /*! specify a pace value for a TX DMA Queue */
60 extern void falcon_nic_pace(struct efhw_nic *nic, uint dmaq, uint pace);
61
62 /*! configure the pace engine */
63 extern void falcon_nic_pace_cfg(struct efhw_nic *nic, int fb_base,
64                                 int bin_thresh);
65
66 /*! confirm buffer table updates - should be used for items where
67    loss of data would be unacceptable. E.g for the buffers that back
68    an event or DMA queue */
69 extern void falcon_nic_buffer_table_confirm(struct efhw_nic *nic);
70
71 /*! Reset the all the TX DMA queue pointers. */
72 extern void falcon_clobber_tx_dma_ptrs(struct efhw_nic *nic, uint dmaq);
73
74 extern int
75 falcon_handle_char_event(struct efhw_nic *nic,
76                          struct efhw_ev_handler *h, efhw_event_t *evp);
77
78 /*! Acknowledge to HW that processing is complete on a given event queue */
79 extern void falcon_nic_evq_ack(struct efhw_nic *nic, uint evq,  /* evq id */
80                                uint rptr,       /* new read pointer update */
81                                bool wakeup      /* request a wakeup event if
82                                                    ptr's != */
83     );
84
85 extern void
86 falcon_nic_buffer_table_set_n(struct efhw_nic *nic, int buffer_id,
87                               dma_addr_t dma_addr, uint bufsz, uint region,
88                               int n_pages, int own_id);
89
90 extern int falcon_nic_filter_ctor(struct efhw_nic *nic);
91
92 extern void falcon_nic_filter_dtor(struct efhw_nic *nic);
93
94 #endif /* __CI_EFHW_FALCON_H__ */