Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci/cxgb Make cxgb at least compilable. Fix _rt_key ...



details:   https://anonhg.NetBSD.org/src/rev/1849321de527
branches:  trunk
changeset: 784284:1849321de527
user:      joerg <joerg%NetBSD.org@localhost>
date:      Wed Jan 23 23:31:26 2013 +0000

description:
Make cxgb at least compilable. Fix _rt_key usage.

diffstat:

 sys/dev/pci/cxgb/cxgb_common.h |   2 +-
 sys/dev/pci/cxgb/cxgb_l2t.c    |   6 +++---
 sys/dev/pci/cxgb/cxgb_main.c   |   4 ++--
 sys/dev/pci/cxgb/cxgb_osdep.h  |  26 --------------------------
 4 files changed, 6 insertions(+), 32 deletions(-)

diffs (113 lines):

diff -r 9773aefea354 -r 1849321de527 sys/dev/pci/cxgb/cxgb_common.h
--- a/sys/dev/pci/cxgb/cxgb_common.h    Wed Jan 23 22:48:18 2013 +0000
+++ b/sys/dev/pci/cxgb/cxgb_common.h    Wed Jan 23 23:31:26 2013 +0000
@@ -668,7 +668,7 @@
 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);
diff -r 9773aefea354 -r 1849321de527 sys/dev/pci/cxgb/cxgb_l2t.c
--- a/sys/dev/pci/cxgb/cxgb_l2t.c       Wed Jan 23 22:48:18 2013 +0000
+++ b/sys/dev/pci/cxgb/cxgb_l2t.c       Wed Jan 23 23:31:26 2013 +0000
@@ -28,7 +28,7 @@
 ***************************************************************************/
 
 #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 @@
 {
     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 @@
     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;
diff -r 9773aefea354 -r 1849321de527 sys/dev/pci/cxgb/cxgb_main.c
--- a/sys/dev/pci/cxgb/cxgb_main.c      Wed Jan 23 22:48:18 2013 +0000
+++ b/sys/dev/pci/cxgb/cxgb_main.c      Wed Jan 23 23:31:26 2013 +0000
@@ -28,7 +28,7 @@
 ***************************************************************************/
 
 #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 @@
             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);
diff -r 9773aefea354 -r 1849321de527 sys/dev/pci/cxgb/cxgb_osdep.h
--- a/sys/dev/pci/cxgb/cxgb_osdep.h     Wed Jan 23 22:48:18 2013 +0000
+++ b/sys/dev/pci/cxgb/cxgb_osdep.h     Wed Jan 23 23:31:26 2013 +0000
@@ -116,10 +116,6 @@
 {
 }
 
-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 @@
 
 #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 @@
 #define if_name(ifp) (ifp)->if_xname
 #define M_SANITY(m, n)
 
-#define __read_mostly __section(".data.read_mostly")
-
 /*
  * Workaround for weird Chelsio issue
  */



Home | Main Index | Thread Index | Old Index