]> git.proxmox.com Git - grub2.git/commitdiff
Remove some dead code
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 22 Sep 2010 18:34:20 +0000 (20:34 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 22 Sep 2010 18:34:20 +0000 (20:34 +0200)
13 files changed:
grub-core/Makefile.core.def
grub-core/net/arp.c
grub-core/net/ethernet.c
grub-core/net/interface.c [deleted file]
grub-core/net/ip.c
grub-core/net/netbuff.c
grub-core/net/tftp.c
grub-core/net/udp.c
include/grub/net.h
include/grub/net/arp.h
include/grub/net/interface.h [deleted file]
include/grub/net/protocol.h [deleted file]
include/grub/net/type_net.h [deleted file]

index d48c5d5051e1a377c9284f63f05434488242c891..49dbd3f60737229cf59306e3d1921f558e41cf1c 100644 (file)
@@ -1438,7 +1438,6 @@ module = {
   common = net/udp.c;
   common = net/ethernet.c;
   common = net/arp.c;
-  common = net/interface.c;
   common = net/netbuff.c;
 };
 
index 5e10938ae77397ee07e7ccb62ef1a82c9fe1dea4..541b89411f309a3930759f6b4c9a8c885917087e 100644 (file)
@@ -1,6 +1,5 @@
 #include <grub/net/arp.h>
 #include <grub/net/netbuff.h>
-#include <grub/net/interface.h>
 #include <grub/mm.h>
 #include <grub/net.h>
 #include <grub/net/ethernet.h>
@@ -92,7 +91,7 @@ grub_net_arp_resolve(struct grub_net_network_level_interface *inf,
           return GRUB_ERR_NONE;
         }
       current_time =  grub_get_time_ms();
-      if (current_time -  start_time > TIMEOUT_TIME_MS)
+      if (current_time -  start_time > 3000)
         break;
     } while (! entry);
   grub_netbuff_clear(nb); 
index d3a34aec64e7cc8fab7bd9a126398908b9c70e15..a40e1f7950ed8c33035072bd0b4901ecce41624e 100644 (file)
@@ -4,7 +4,6 @@
 #include <grub/net/ip.h>
 #include <grub/net/arp.h>
 #include <grub/net/netbuff.h>
-#include <grub/net/interface.h>
 #include <grub/net.h>
 #include <grub/time.h>
 #include <grub/net/arp.h>
diff --git a/grub-core/net/interface.c b/grub-core/net/interface.c
deleted file mode 100644 (file)
index f17b3e6..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*#include <grub/net/interface.h>
-
-#define INTERFACE_REGISTER_FUNCTIONS(layerprevious,layernext) \
-struct grub_net_##layername_layer_protocol *grub_net_##layername_layer_protocols;\
-\
-void grub_net_##layerprevious_##layernext_interface_register (struct grub_net_##layername_layer_protocol *prot)\
-{\
-  grub_list_push (GRUB_AS_LIST_P (&grub_net_##layername_layer_protocols),\
-                 GRUB_AS_LIST (prot));\
-}\
-\
-void grub_net_##layerprevious_##layernext_interface_unregister (struct grub_net_##layername_layer_protocol *prot);\
-{\
-  grub_list_remove (GRUB_AS_LIST_P (&grub_net_##layername_layer_protocols),\
-                   GRUB_AS_LIST (prot));\
-}\
-
-INTERFACE_REGISTER_FUNCTIONS("application","transport");
-INTERFACE_REGISTER_FUNCTIONS("transport","network");
-INTERFACE_REGISTER_FUNCTIONS("network","link");
-INTERFACE_REGISTER_FUNCTIONS("link");*/
-
-#include <grub/mm.h>
-#include <grub/net/interface.h>
-struct grub_net_protocol_stack 
-  *grub_net_protocol_stack_get (char *name)
-{
- struct grub_net_protocol_stack *p;
-
-  for (p = grub_net_protocol_stacks; p; p = p->next)
-  {
-    if (!grub_strcmp(p->name,name))
-      return p;
-  }
-  
-  return  NULL; 
-}
index 264195ad3fa548bf795beade271167532978992f..023564a5ae1c70dd25fea205c256a0644dfd5473 100644 (file)
@@ -2,8 +2,6 @@
 #include <grub/misc.h>
 #include <grub/net/arp.h>
 #include <grub/net/ethernet.h>
-#include <grub/net/interface.h>
-#include <grub/net/type_net.h>
 #include <grub/net.h>
 #include <grub/net/netbuff.h>
 #include <grub/mm.h>
index 4f6a1da84b3c6cf5a45bc73a8d6f4a42d7544122..cc366ae09ec92ebc97d1729fa41bd617fcaf4810 100644 (file)
@@ -73,7 +73,7 @@ struct grub_net_buff *grub_netbuff_alloc ( grub_size_t len )
   
   len = ALIGN_UP (len,NETBUFF_ALIGN);
   data = grub_memalign (NETBUFF_ALIGN, len + sizeof (*nb));
-  nb = (struct grub_net_buff *) ((int)data + len); 
+  nb = (struct grub_net_buff *) ((grub_uint8_t *) data + len); 
   nb->head = nb->data = nb->tail = data;
   nb->end = (char *) nb; 
   
index bb518b78f5fb09485f19d10bea1df98d229e85a9..b9e3f49c4bf72c98a0497d2669972a2dc1b6f847 100644 (file)
@@ -4,8 +4,6 @@
 #include <grub/net/ip.h>
 #include <grub/net/ethernet.h>
 #include <grub/net/netbuff.h>
-#include <grub/net/interface.h>
-#include <grub/net/type_net.h>
 #include <grub/net.h>
 #include <grub/mm.h>
 #include <grub/dl.h>
index 27e23e82678b68948e46ed3bad45ceb8de6a1998..a73431f83cca390f880579b8a1b2db0a705299d4 100644 (file)
@@ -1,10 +1,7 @@
 #include <grub/net.h>
 #include <grub/net/udp.h>
 #include <grub/net/ip.h>
-#include <grub/net/type_net.h>
 #include <grub/net/netbuff.h>
-#include <grub/net/protocol.h>
-#include <grub/net/interface.h>
 #include <grub/time.h>
 
 grub_err_t
index de188f615d641b45b7d23fbacf9494c7759fee07..20bf3c0e61042da6dc3f3ba80ba3add690fdef6d 100644 (file)
@@ -23,9 +23,8 @@
 #include <grub/err.h>
 #include <grub/list.h>
 #include <grub/fs.h>
+#include <grub/mm.h>
 #include <grub/net/netbuff.h>
-#include <grub/net/type_net.h>
-#include <grub/net/protocol.h>
 
 typedef struct grub_fs *grub_net_app_level_t;
 
index e547669a258fa46ac06d40ca5d239a721194a100..1475086e4e8e63d446245edd620b7403362c32de 100644 (file)
@@ -2,7 +2,6 @@
 #define GRUB_NET_ARP_HEADER    1
 #include <grub/misc.h>
 #include <grub/net.h>
-#include <grub/net/protocol.h>
 
 /* IANA ARP constant to define hardware type as ethernet */
 #define ARPHRD_ETHERNET 1
diff --git a/include/grub/net/interface.h b/include/grub/net/interface.h
deleted file mode 100644 (file)
index cf24dd2..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef GRUB_INTERFACE_HEADER
-#define GRUB_INTERFACE_HEADER
-//#include <grub/net.h>
-#include <grub/net/type_net.h>
-#include <grub/list.h>
-#include <grub/misc.h>
-
-struct grub_net_protocol_stack
-{
-  struct grub_net_protocol_stack *next;
-  char *name;
-  grub_net_protocol_id_t id;
-  void *interface;
-};
-
-struct grub_net_application_transport_interface
-{
-  struct grub_net_transport_network_interface *inner_layer; 
-  void *data;
-  struct grub_net_application_layer_protocol *app_prot;
-  struct grub_net_transport_layer_protocol *trans_prot;
-};
-
-struct grub_net_transport_network_interface
-{
-  struct grub_net_network_link_interface *inner_layer; 
-  void *data;
-  struct grub_net_transport_layer_protocol *trans_prot;
-  struct grub_net_network_layer_protocol *net_prot;
-};
-
-struct grub_net_network_link_interface
-{
-  void *data;
-  struct grub_net_network_layer_protocol *net_prot;
-  struct grub_net_link_layer_protocol *link_prot;
-};
-
-
-struct grub_net_protocol_stack *grub_net_protocol_stacks;
-static inline void
-grub_net_stack_register (struct grub_net_protocol_stack *stack)
-{
-
-  grub_list_push (GRUB_AS_LIST_P (&grub_net_protocol_stacks),
-                 GRUB_AS_LIST (stack));
-}
-/*
-void grub_net_stack_unregister (struct grub_net_protocol_stack *stack)
-{
-  grub_list_remove (GRUB_AS_LIST_P (&grub_net_protocol_stacks),
-                   GRUB_AS_LIST (stack));
-}*/
-
-struct grub_net_protocol_stack   *grub_net_protocol_stack_get (char *name);
-
-/*
-static inline void
-grub_net_interface_application_transport_register (struct grub_net_application_transport_interface);
-static inline void
-grub_net_interface_application_transport_unregister (struct grub_net_application_transport_interface);
-static inline void
-grub_net_interface_transport_network_register (struct grub_net_transport_network_interface);
-static inline void
-grub_net_interface_transport_network_unregister (struct grub_net_transport_network_interface);
-static inline void
-grub_net_interface_network_link_register (struct grub_net_network_link_interface);
-static inline void
-grub_net_interface_network_link_unregister (struct grub_net_network_link_interface);*/
-#endif
diff --git a/include/grub/net/protocol.h b/include/grub/net/protocol.h
deleted file mode 100644 (file)
index da54b07..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef GRUB_PROTOCOL_HEADER
-#define GRUB_PROTOCOL_HEADER
-#include <grub/err.h>
-#include <grub/mm.h>
-#include <grub/net/interface.h>
-#include <grub/net/netbuff.h>
-#include <grub/net/type_net.h>
-
-#endif
diff --git a/include/grub/net/type_net.h b/include/grub/net/type_net.h
deleted file mode 100644 (file)
index f159b1d..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef GRUB_TYPES_NET_HEADER
-#define GRUB_TYPES_NET_HEADER  1
-#include <grub/misc.h>
-
-
-#define UDP_PCKT 0x11
-#define IP_PCKT 0x0800
-#define TIMEOUT_TIME_MS 3*1000 
-typedef enum
-{
- GRUB_NET_TFTP_ID,
- GRUB_NET_UDP_ID,
- GRUB_NET_IPV4_ID,
- GRUB_NET_IPV6_ID,
- GRUB_NET_ETHERNET_ID,
- GRUB_NET_ARP_ID,
- GRUB_NET_DHCP_ID
-}grub_net_protocol_id_t;
-
-
-typedef union grub_net_network_layer_netaddress
-{
-  grub_uint32_t ipv4;
-} grub_net_network_layer_address_t;
-
-typedef union grub_net_network_layer_address
-{
-  struct {
-    grub_uint32_t base;
-    int masksize; 
-  } ipv4;
-} grub_net_network_layer_netaddress_t;
-#endif