[ofw] ibbus filter driver patch 2/18 - bus_driver.h

Smith, Stan stan.smith at intel.com
Mon Aug 18 14:43:10 PDT 2008


Signed-off by: Stan Smith (stan.smith at intel.com)

Having problems with Intel mailer, hence formatting of patch is incorrect, see attached patch file.

diff -Naur --exclude-from=./SKIP kernel-svn/bus_driver.h kernel/bus_driver.h
--- kernel-svn/bus_driver.h     2008-07-08 12:01:36.000000000 -0700
+++ kernel/bus_driver.h 2008-08-18 09:20:12.646684100 -0700
@@ -27,7 +27,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  *
- * $Id: bus_driver.h 1307 2008-06-29 16:45:16Z leonidk $
+ * $Id: bus_driver.h 1453 2008-08-02 00:43:15Z stansmith $
  */


@@ -74,7 +74,12 @@
        CL_TRACE_EXIT( lvl, bus_globals.dbg_lvl, msg )

 #define BUS_PRINT( lvl, msg )          \
-       CL_PRINT( lvl, bus_globals.dbl_lvl, msg )
+       CL_PRINT( lvl, bus_globals.dbg_lvl, msg )
+
+/* single character Macro elemination */
+#define XBUS_PRINT( lvl, msg )
+#define XBUS_ENTER( lvl )
+#define XBUS_EXIT( lvl )

 #define BUS_DBG_ERROR  CL_DBG_ERROR
 #define BUS_DBG_DRV            (1 << 0)
@@ -93,7 +98,6 @@
  *             in the paging, crash dump, or hibernation path.
  */

-
 /*
  * Device extension for the device object that serves as entry point for
  * the interface and IOCTL requests.
@@ -112,15 +116,13 @@
        port_mgr_t                              *p_port_mgr;
        iou_mgr_t                               *p_iou_mgr;

-       /* Interface names are generated by IoRegisterDeviceInterface. */
-       UNICODE_STRING                  al_ifc_name;
-       UNICODE_STRING                  ci_ifc_name;
-
        /* Number of references on the upper interface. */
        atomic32_t                              n_al_ifc_ref;
        /* Number of references on the CI interface. */
        atomic32_t                              n_ci_ifc_ref;

+       struct _bus_filter_instance *bus_filter;
+
 }      bus_fdo_ext_t;


@@ -174,7 +176,7 @@
        boolean_t                               b_reported_missing;

        /* Flag to control the behaviour of the driver during hibernation */
-       uint32_t                                        b_hibernating;
+       uint32_t                                b_hibernating;

        /* work item for handling Power Management request */
        PIO_WORKITEM                    p_po_work_item;
@@ -196,13 +198,62 @@
        /* Driver object.  Used for registering of Plug and Play notifications. */
        DRIVER_OBJECT                   *p_driver_obj;

-       /* Pointer to the one and only bus root. */
-       bus_fdo_ext_t                   *p_bus_ext;
+       /* IBAL PNP event register handles */
+       ib_pnp_handle_t                 h_pnp_port;
+       ib_pnp_handle_t                 h_pnp_iou;

 }      bus_globals_t;


 extern bus_globals_t   bus_globals;

+/*
+ * Each instance of a bus filter on an HCA device stack (InfiniBandController)
+ * populates a bus_filter_t slot in bus_filters[MAX_BUS_FILTERS]; see
+ * bus_add_device(). Therefore MAX_BUS_FILTERS represents the MAX number of
+ * HCA's supported in a single system.
+ */
+#define MAX_BUS_FILTERS        16
+#define BFI_MAGIC              0xcafebabe
+
+#define BFI_PORT_MGR_OBJ       1
+#define BFI_IOU_MGR_OBJ                2
+
+
+typedef struct _bus_filter_instance
+{
+       /* Pointer to the bus filter instance FDO extention.
+        * if p_bus_ext is NULL, then it's an empty slot available for allocation
+        */
+       bus_fdo_ext_t                   *p_bus_ext;
+
+       /* HCA guid for which this bus filter is servicing */
+       ib_net64_t                              ca_guid;
+
+       /* PORT management - on a per HCA basis */
+       port_mgr_t                              *p_port_mgr;
+       cl_obj_t                                *p_port_mgr_obj;
+
+       /* IOU management - on a per HCA basis */
+       iou_mgr_t                               *p_iou_mgr;
+       cl_obj_t                                *p_iou_mgr_obj;
+#if DBG
+       ULONG                                   magic; // initial/temp debug
+       char                                    whoami[8];
+#endif
+
+}      bus_filter_t;
+
+extern bus_filter_t    bus_filters[MAX_BUS_FILTERS];
+extern ULONG bfi_InstanceCount;
+extern FAST_MUTEX ControlMutex;        // serializes InstanceCount & bus_filters
+
+extern bus_filter_t *alloc_bfi( IN DRIVER_OBJECT *, OUT int * );
+extern int free_bfi( IN bus_filter_t *p_bfi );
+extern int get_bfi_count( void );
+extern bus_filter_t *get_bfi_by_obj( IN int obj_type, IN cl_obj_t *p_obj );
+extern bus_filter_t *get_bfi_by_ca_guid( IN net64_t ca_guid );
+extern bus_filter_t *get_set_bfi_by_ca_guid( IN net64_t ca_guid );
+extern char *get_obj_state_str(cl_state_t state);

 #endif /* !defined _BUS_DRIVER_H_ */
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bus_driver.h
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20080818/aec54153/attachment.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bus_driver.h.pat
Type: application/octet-stream
Size: 3853 bytes
Desc: bus_driver.h.pat
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20080818/aec54153/attachment.obj>


More information about the ofw mailing list