svn commit: r207075 - user/jmallett/octeon/sys/mips/cavium/octe
Juli Mallett
jmallett at FreeBSD.org
Thu Apr 22 21:10:22 UTC 2010
Author: jmallett
Date: Thu Apr 22 21:10:22 2010
New Revision: 207075
URL: http://svn.freebsd.org/changeset/base/207075
Log:
Comment out a bunch of stuff. Now, except for the procfs module, all of this
driver compiles and linking is only held back by trivial BSP differences in
FreeBSD and Linux.
Modified:
user/jmallett/octeon/sys/mips/cavium/octe/ethernet-mem.c
user/jmallett/octeon/sys/mips/cavium/octe/ethernet.c
Modified: user/jmallett/octeon/sys/mips/cavium/octe/ethernet-mem.c
==============================================================================
--- user/jmallett/octeon/sys/mips/cavium/octe/ethernet-mem.c Thu Apr 22 21:03:14 2010 (r207074)
+++ user/jmallett/octeon/sys/mips/cavium/octe/ethernet-mem.c Thu Apr 22 21:10:22 2010 (r207075)
@@ -26,10 +26,17 @@ TO THE MAXIMUM EXTENT PERMITTED BY LAW,
AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
*************************************************************************/
-#include <linux/kernel.h>
-#include <linux/netdevice.h>
-#include <linux/mii.h>
-#include <net/dst.h>
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/endian.h>
+#include <sys/kernel.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+
+#include <net/ethernet.h>
+#include <net/if.h>
#include "wrapper-cvmx-includes.h"
#include "ethernet-headers.h"
@@ -46,15 +53,19 @@ static int cvm_oct_fill_hw_mbuf(int pool
int freed = elements;
while (freed) {
+#if 0
struct mbuf *m = dev_alloc_m(size + 128);
- if (unlikely(m == NULL)) {
- pr_warning("Failed to allocate m for hardware pool %d\n", pool);
+ if (__predict_false(m == NULL)) {
+ printf("Failed to allocate m for hardware pool %d\n", pool);
break;
}
m_reserve(m, 128 - (((unsigned long)m->data) & 0x7f));
*(struct mbuf **)(m->data - sizeof(void *)) = m;
cvmx_fpa_free(m->data, pool, DONT_WRITEBACK(size/128));
+#else
+ panic("%s: need to implement mbuf allocation.", __func__);
+#endif
freed--;
}
return (elements - freed);
@@ -77,7 +88,7 @@ static void cvm_oct_free_hw_mbuf(int poo
if (memory) {
struct mbuf *m = *(struct mbuf **)(memory - sizeof(void *));
elements--;
- dev_kfree_m(m);
+ m_freem(m);
}
} while (memory);
@@ -104,6 +115,7 @@ static int cvm_oct_fill_hw_memory(int po
int freed = elements;
if (USE_32BIT_SHARED) {
+#if 0
extern uint64_t octeon_reserve32_memory;
memory = cvmx_bootmem_alloc_range(elements*size, 128, octeon_reserve32_memory,
@@ -118,12 +130,19 @@ static int cvm_oct_fill_hw_memory(int po
memory += size;
freed--;
}
+#else
+ panic("%s: may need to implement using shared memory.", __func__);
+#endif
} else {
while (freed) {
/* We need to force alignment to 128 bytes here */
+#if 0
memory = kmalloc(size + 127, GFP_ATOMIC);
- if (unlikely(memory == NULL)) {
- pr_warning("Unable to allocate %u bytes for FPA pool %d\n", elements*size, pool);
+#else
+ panic("%s: not yet implemented.", __func__);
+#endif
+ if (__predict_false(memory == NULL)) {
+ printf("Unable to allocate %u bytes for FPA pool %d\n", elements*size, pool);
break;
}
memory = (char *)(((unsigned long)memory+127) & -128);
@@ -152,7 +171,11 @@ static void cvm_oct_free_hw_memory(int p
memory = cvmx_fpa_alloc(pool);
if (memory) {
elements--;
+#if 0
kfree(phys_to_virt(cvmx_ptr_to_phys(memory)));
+#else
+ panic("%s: not yet implemented.", __func__);
+#endif
}
} while (memory);
Modified: user/jmallett/octeon/sys/mips/cavium/octe/ethernet.c
==============================================================================
--- user/jmallett/octeon/sys/mips/cavium/octe/ethernet.c Thu Apr 22 21:03:14 2010 (r207074)
+++ user/jmallett/octeon/sys/mips/cavium/octe/ethernet.c Thu Apr 22 21:10:22 2010 (r207075)
@@ -342,7 +342,9 @@ static int cvm_oct_init_module(void)
printf("cavium-ethernet: %s\n", OCTEON_SDK_VERSION_STRING);
+#if 0
cvm_oct_proc_initialize();
+#endif
cvm_oct_rx_initialize();
cvm_oct_configure_common_hw();
@@ -569,7 +571,9 @@ static void cvm_oct_cleanup_module(void)
}
cvmx_pko_shutdown();
+#if 0
cvm_oct_proc_shutdown();
+#endif
cvmx_ipd_free_ptr();
More information about the svn-src-user
mailing list