Skip to contentSkip to conversation

BE NIC driver - net_object i/f functions, Makefile

PATCH In review Subbu Seetharaman 2 participants 2 messages Jun 3, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/12 BE NIC driver - net_object i/f functions, Makefile

---
 drivers/net/benet/Makefile |   22 +
 drivers/net/benet/bni.c    | 1410 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 1432 insertions(+), 0 deletions(-)
 create mode 100644 drivers/net/benet/Makefile
 create mode 100644 drivers/net/benet/bni.c
drivers/net/benet/Makefile new file +22 -0
new file mode 100644
index 0000000..b9f4c52
@@ -0,0 +1,22 @@
+#
+# Makefile to build the network driver for ServerEngine's BladeEngine.
+#
+BECLIBPATH = $(src)/../../message/beclib
+
+EXTRA_CFLAGS = -Wno-unknown-pragmas -DFUNCTION_NIC -I$(BECLIBPATH) \
+	-DCONFIG_BENET_NAPI -I$(BECLIBPATH)/fw -I$(BECLIBPATH)/fw/amap -I$(BECLIBPATH)/fw/bmap 
+
+obj-$(CONFIG_BENET) 	:= benet.o
+
+benet-objs	:=  be_init.o be_int.o be_netif.o be_ethtool.o bni.o \
+	../../message/beclib/funcobj_ll.o  \
+	../../message/beclib/chipobj_ll.o \
+	../../message/beclib/cq_ll.o \
+	../../message/beclib/eq_ll.o \
+	../../message/beclib/main_ll.o \
+	../../message/beclib/mpu_ll.o \
+	../../message/beclib/ethrx_ll.o \
+	../../message/beclib/ethtx_ll.o \
+	../../message/beclib/rxf_ll.o
+
+clean-files := ../../message/beclib/*.o
drivers/net/benet/bni.c new file +1410 -0

1,410 lines not on this page · raw message

Signature · 8 lines
1.5.5

___________________________________________________________________________________
This message, together with any attachment(s), contains confidential and proprietary information of
ServerEngines Corporation and is intended only for the designated recipient(s) named above. Any unauthorized
review, printing, retention, copying, disclosure or distribution is strictly prohibited.  If you are not the
intended recipient of this message, please immediately advise the sender by reply email message and
delete all copies of this message and any attachment(s). Thank you.
#1 lore raw
Quoted 22 lines
drivers/net/benet/bni.c new file +21 -0
+/*
+
+@file
+    bni.c
+
+@brief
+    This file contains finctions that will be used by the BladeEngine
+    Network drivers to access BladeEngine Hardware. All code in
+    this file must be completely OS neutral.
+
+*/
+
+#include "bni.h"
+
+/*!
+   This function initializes the data structures in BNI / BECLIB for network
+   operation.  The OSM driver must call this function before making any other
+   BNI call.
+
+   If this functions succeeds, the caller must call bni_cleanup() as part
+   of driver cleanup procedure.

drivers/net/benet/bni.c line 47

Quoted 10 lines
drivers/net/benet/bni.c new file +10 -0
+
+@param
+    chipobj      -  Address of the space allocated by OSM for chip object
+			(struct be_chip_object).  The space for this is
+			allocated by OSM, but this object is maintained
+			by BECLIB and is opaque to OSM.
+@return
+    BESTATUS - (0 if successful, non-zero status code if not successful)
+
+ */

You commenting standard is similar but not compatiable with kernel docboock. But I don't consider this a blocker to inclusion, just a nuisance.

drivers/net/benet/bni.c line 59

Quoted 12 lines
drivers/net/benet/bni.c new file +12 -0
+BESTATUS bni_init(struct be_chip_object *chipobj)
+{
+	int r;
+	r = be_initialize_library();
+	if (r != BE_SUCCESS)
+		goto error;
+	r = be_chip_object_create(chipobj);
+	if (r != BE_SUCCESS)
+		goto error;
+error:
+	return (r);
+}

But this overly verbose code style is the style of code which should be cleaned up (after inclusion). It is the reason that kernel developers hate drivers that try to be OS independent. They end up looking like the kind of rubbish written by contracting software houses that are paid by the line of code.