Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


made virtio nic an experimental feature
[palacios.git] / palacios / src / devices / ne2k.c
index d6399d8..9df0871 100644 (file)
@@ -29,7 +29,7 @@
 #include <palacios/vmm_debug.h>
 #include <palacios/vmm_string.h>
 
-#ifndef DEBUG_NE2K
+#ifndef CONFIG_DEBUG_NE2K
 #undef PrintDebug
 #define PrintDebug(fmts, args...)
 #endif
@@ -322,15 +322,9 @@ struct ne2k_context {
     } __attribute__((packed));
 
 
-
-
-
     uint8_t      mcast_addr[8];  // multicast mask array 
     uint8_t      mac_addr[6];    // MAC Addr
 
-
-
-
     uint8_t mem[NE2K_MEM_SIZE];
 
     struct pci_device * pci_dev;
@@ -339,7 +333,7 @@ struct ne2k_context {
 
 #define compare_mac(src, dst) !memcmp(src, dst, 6)
 
-#ifdef DEBUG_NE2K
+#ifdef CONFIG_DEBUG_NE2K
 static void dump_state(struct vm_device * dev) {
     struct ne2k_context *nic_state = (struct ne2k_context *)dev->private_data;
     int i;
@@ -380,7 +374,6 @@ static int ne2k_update_irq(struct vm_device *dev) {
        return -1;
     }
 
-    PrintDebug("Ne2k: RaiseIrq: isr: 0x%02x imr: 0x%02x\n", nic_state->isr.val, nic_state->imr.val);
     PrintDebug("ne2k_update_irq: irq_line: %d\n", irq_line);
 
 
@@ -420,7 +413,7 @@ static void ne2k_init_state(struct vm_device * dev) {
     nic_state->mem[14] = 0x57;
     nic_state->mem[15] = 0x57;
 
-#ifdef DEBUG_NE2K
+#ifdef CONFIG_DEBUG_NE2K
     dump_state(dev);
 #endif
 
@@ -474,7 +467,7 @@ static void ne2k_receive(struct vm_device * dev, const uchar_t * pkt, int length
     uint32_t total_len;
     uint32_t next;
     uint32_t len;
-    uin32_t index;
+    uint32_t index;
     uint32_t empty;
     uchar_t buf[60];
     uint32_t start;
@@ -565,7 +558,7 @@ static int netif_input(uchar_t *pkt, uint_t size) {
     static const uchar_t brocast_mac[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
     int i;
   
-#ifdef DEBUG_NE2K
+#ifdef CONFIG_DEBUG_NE2K
     PrintDebug("\nNe2k: Packet Received:\nSource:");
     for (i = 6; i < 12; i++) {
        PrintDebug("%x ", pkt[i]);
@@ -1153,7 +1146,7 @@ static int ne2k_init_device(struct vm_device * dev) {
     }
     
 
-#ifdef DEBUG_NE2K
+#ifdef CONFIG_DEBUG_NE2K
     dump_state(dev);
 #endif
 
@@ -1176,7 +1169,7 @@ static int ne2k_deinit_device(struct vm_device *dev) {
 }
 
 
-static struct vm_device_ops dev_ops = { 
+static struct v3_device_ops dev_ops = { 
     .init = ne2k_init_device, 
     .deinit = ne2k_deinit_device,
     .reset = ne2k_reset_device,