Module Name:    src
Committed By:   joerg
Date:           Wed Jan 23 23:31:27 UTC 2013

Modified Files:
        src/sys/dev/pci/cxgb: cxgb_common.h cxgb_l2t.c cxgb_main.c cxgb_osdep.h

Log Message:
Make cxgb at least compilable. Fix _rt_key usage.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/cxgb/cxgb_common.h \
    src/sys/dev/pci/cxgb/cxgb_l2t.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/cxgb/cxgb_main.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pci/cxgb/cxgb_osdep.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/cxgb/cxgb_common.h
diff -u src/sys/dev/pci/cxgb/cxgb_common.h:1.1 src/sys/dev/pci/cxgb/cxgb_common.h:1.2
--- src/sys/dev/pci/cxgb/cxgb_common.h:1.1	Sun Mar 21 21:11:13 2010
+++ src/sys/dev/pci/cxgb/cxgb_common.h	Wed Jan 23 23:31:26 2013
@@ -668,7 +668,7 @@ int t3_read_flash(adapter_t *adapter, un
 int t3_get_tp_version(adapter_t *adapter, u32 *vers);
 int t3_check_tpsram_version(adapter_t *adapter);
 int t3_check_tpsram(adapter_t *adapter, const u8 *tp_ram, unsigned int size);
-int t3_load_fw(adapter_t *adapter, const const u8 *fw_data, unsigned int size);
+int t3_load_fw(adapter_t *adapter, const u8 *fw_data, unsigned int size);
 int t3_get_fw_version(adapter_t *adapter, u32 *vers);
 int t3_check_fw_version(adapter_t *adapter);
 int t3_init_hw(adapter_t *adapter, u32 fw_params);
Index: src/sys/dev/pci/cxgb/cxgb_l2t.c
diff -u src/sys/dev/pci/cxgb/cxgb_l2t.c:1.1 src/sys/dev/pci/cxgb/cxgb_l2t.c:1.2
--- src/sys/dev/pci/cxgb/cxgb_l2t.c:1.1	Sun Mar 21 21:11:13 2010
+++ src/sys/dev/pci/cxgb/cxgb_l2t.c	Wed Jan 23 23:31:26 2013
@@ -28,7 +28,7 @@ POSSIBILITY OF SUCH DAMAGE.
 ***************************************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cxgb_l2t.c,v 1.1 2010/03/21 21:11:13 jklos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cxgb_l2t.c,v 1.2 2013/01/23 23:31:26 joerg Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -346,7 +346,7 @@ t3_l2t_get(struct toedev *dev, struct rt
 {
     struct l2t_entry *e;
     struct l2t_data *d = L2DATA(dev);
-    u32 addr = *(u32 *)neigh->_rt_key;
+    u32 addr = ((struct sockaddr_in *)rt_getkey(neigh))->sin_addr.s_addr;
     int ifidx = neigh->rt_ifp->if_index;
     int hash = arp_hash(addr, ifidx, d);
 
@@ -427,7 +427,7 @@ t3_l2t_update(struct toedev *dev, struct
     struct l2t_entry *e;
     struct mbuf *arpq = NULL;
     struct l2t_data *d = L2DATA(dev);
-    u32 addr = *(u32 *)neigh->_rt_key;
+    u32 addr = ((struct sockaddr_in *)rt_getkey(neigh))->sin_addr.s_addr;
     int ifidx = neigh->rt_ifp->if_index;
     int hash = arp_hash(addr, ifidx, d);
     struct llinfo_arp *la;

Index: src/sys/dev/pci/cxgb/cxgb_main.c
diff -u src/sys/dev/pci/cxgb/cxgb_main.c:1.3 src/sys/dev/pci/cxgb/cxgb_main.c:1.4
--- src/sys/dev/pci/cxgb/cxgb_main.c:1.3	Sat Oct 27 17:18:36 2012
+++ src/sys/dev/pci/cxgb/cxgb_main.c	Wed Jan 23 23:31:26 2013
@@ -28,7 +28,7 @@ POSSIBILITY OF SUCH DAMAGE.
 ***************************************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cxgb_main.c,v 1.3 2012/10/27 17:18:36 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cxgb_main.c,v 1.4 2013/01/23 23:31:26 joerg Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1123,7 +1123,7 @@ cxgb_up(struct adapter *sc)
             err = EINVAL;
             goto out;
         }
-        device_printf(sc->dev, "allocated intr_handle=%p\n", sc->intr_handle);
+        device_printf(sc->dev, "allocated intr_handle=%d\n", sc->intr_handle);
         sc->intr_cookie = pci_intr_establish(sc->pa.pa_pc,
                     sc->intr_handle, IPL_NET,
                     sc->cxgb_intr, sc);

Index: src/sys/dev/pci/cxgb/cxgb_osdep.h
diff -u src/sys/dev/pci/cxgb/cxgb_osdep.h:1.2 src/sys/dev/pci/cxgb/cxgb_osdep.h:1.3
--- src/sys/dev/pci/cxgb/cxgb_osdep.h:1.2	Wed May 18 01:01:59 2011
+++ src/sys/dev/pci/cxgb/cxgb_osdep.h	Wed Jan 23 23:31:27 2013
@@ -116,10 +116,6 @@ static inline void critical_exit(void)
 {
 }
 
-static inline void device_printf(device_t d, ...)
-{
-}
-
 int atomic_fetchadd_int(volatile int *p, int v);
 #if 0
 int atomic_add_int(volatile int *p, int v);
@@ -174,26 +170,6 @@ struct cxgb_attach_args
 
 #define INT3 __asm("int $3")
 
-static inline struct mbuf *
-m_defrag(struct mbuf *m0, int flags)
-{
-        struct mbuf *m;
-        MGETHDR(m, flags, MT_DATA);
-        if (m == NULL)
-                return NULL;
-
-        M_COPY_PKTHDR(m, m0);
-        MCLGET(m, flags);
-        if ((m->m_flags & M_EXT) == 0) {
-                m_free(m);
-                return NULL;
-        }
-        m_copydata(m0, 0, m0->m_pkthdr.len, mtod(m, void *));
-        m->m_len = m->m_pkthdr.len;
-        return m;
-}
-
-
 typedef struct adapter adapter_t;
 struct sge_rspq;
 
@@ -215,8 +191,6 @@ struct t3_mbuf_hdr {
 #define if_name(ifp) (ifp)->if_xname
 #define M_SANITY(m, n)
 
-#define __read_mostly __section(".data.read_mostly")
-
 /*
  * Workaround for weird Chelsio issue
  */

Reply via email to