net: Refactor to protect access to the NetState variable

Changes to NetState now go through an accessor function called
net_set_state()

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index ba02fd7..28bb955 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -44,19 +44,19 @@
 				 IPaddr_t sip, unsigned src,
 				 unsigned len)
 {
-	NetState = NETLOOP_SUCCESS; /* got arp reply - quit net loop */
+	net_set_state(NETLOOP_SUCCESS); /* got arp reply - quit net loop */
 }
 
 static void nc_handler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src,
 			unsigned len)
 {
 	if (input_size)
-		NetState = NETLOOP_SUCCESS; /* got input - quit net loop */
+		net_set_state(NETLOOP_SUCCESS); /* got input - quit net loop */
 }
 
 static void nc_timeout(void)
 {
-	NetState = NETLOOP_SUCCESS;
+	net_set_state(NETLOOP_SUCCESS);
 }
 
 void NcStart(void)