Permalink
Browse files

MSI update and stuff

Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
  • Loading branch information...
1 parent 8cb2d31 commit 24a335c837e198dc43818881cfc5880b4a9f76ab @xl0 committed Jun 13, 2011
Showing with 582 additions and 92 deletions.
  1. +4 −2 virtio/make-n-install.sh
  2. +4 −3 virtio/rem.sh
  3. +17 −0 virtio/util.h
  4. +337 −31 virtio/virtio.c
  5. +4 −1 virtio/virtioreg.h
  6. +20 −4 virtio/virtiovar.h
  7. +1 −1 virtio_net/Makefile
  8. +195 −50 virtio_net/vioif.c
View
@@ -4,7 +4,9 @@ export PATH=$PATH:/sbin:/usr/sbin
./rem.sh
-make clean && make && sudo modload virtio
-sudo cp virtio /kernel/drv/amd64
+make clean && make
+sudo modload ./virtio
+#sudo cp virtio /kernel/drv/amd64
+#sudo update_drv -f virtio
#make clean && make && sudo cp virtio /kernel/drv/amd64/ && sudo update_drv virtio
View
@@ -2,9 +2,10 @@
export PATH=$PATH:/sbin:/usr/sbin
-sudo ifconfig virtio_net0 unplumb
-sudo modunload -i `modinfo | grep virtio_net | cut -d " " -f 1`
-sudo modunload -i `modinfo | grep virtio | cut -d " " -f 1`
+sudo ifconfig vioif0 down
+sudo ifconfig vioif0 unplumb
+sudo modunload -i `modinfo | grep vioif | grep -v vioifx | cut -d " " -f 1`
+sudo modunload -i `modinfo | grep virtio | grep -v virtiox | cut -d " " -f 1`
#sudo rem_drv virtio
#sudo rm /kernel/drv/amd64/virtio
View
@@ -1,7 +1,24 @@
#include <sys/dditypes.h>
+#include <sys/sysmacros.h>
void dev_err(dev_info_t *dip, int ce, char *fmt, ...);
void dev_panic(dev_info_t *dip, char *fmt, ...);
void hex_dump(char *prefix, void *addr, int len);
+
+static inline int up_to_power2(int i) {
+
+ if (ISP2(i))
+ return i;
+
+ /* Highbit returns h+1. */
+ return (1 << (highbit(i) - 1));
+}
+
+/* XXX Stolen from the Linux kernel! Need to find a BSD one, or too trivial to
+ * be copyrightable? */
+#define container_of(ptr, type, member) ({ \
+ const typeof( ((type *)0)->member ) *__mptr = (ptr); \
+ (type *)( (char *)__mptr - offsetof(type,member) );})
+
Oops, something went wrong.

0 comments on commit 24a335c

Please sign in to comment.