Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-6]: src/sys/arch/sparc/stand/ofwboot Pull up following revision(s...
details: https://anonhg.NetBSD.org/src/rev/0fcb1a7845b0
branches: netbsd-6
changeset: 774350:0fcb1a7845b0
user: riz <riz%NetBSD.org@localhost>
date: Sat Jul 21 00:04:56 2012 +0000
description:
Pull up following revision(s) (requested by tsutsui in ticket #433):
sys/arch/sparc/stand/ofwboot/net.h: revision 1.3
sys/arch/sparc/stand/ofwboot/net.c: revision 1.8
sys/arch/sparc/stand/ofwboot/ofdev.c: revision 1.33
Fix tftpboot which was broken by my botched WARNSfy in last year.
Also add comments that mention libsa tftp requires network device socket
in f_devdata in struct open_file, from spz@ in PR port-sparc64/46652.
Briefly tested tftpboot and nfsboot on Ultra5.
diffstat:
sys/arch/sparc/stand/ofwboot/net.c | 18 ++++++++++++++++--
sys/arch/sparc/stand/ofwboot/net.h | 4 ++--
sys/arch/sparc/stand/ofwboot/ofdev.c | 4 ++--
3 files changed, 20 insertions(+), 6 deletions(-)
diffs (75 lines):
diff -r e1d1e1bacabb -r 0fcb1a7845b0 sys/arch/sparc/stand/ofwboot/net.c
--- a/sys/arch/sparc/stand/ofwboot/net.c Sat Jul 21 00:03:19 2012 +0000
+++ b/sys/arch/sparc/stand/ofwboot/net.c Sat Jul 21 00:04:56 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: net.c,v 1.7 2011/05/21 15:50:42 tsutsui Exp $ */
+/* $NetBSD: net.c,v 1.7.10.1 2012/07/21 00:04:56 riz Exp $ */
/*
* Copyright (C) 1995 Wolfgang Solfrank.
@@ -180,14 +180,28 @@
return (0);
}
+/*
+ * libsa's tftp_open expects a pointer to netdev_sock, i.e. an (int *),
+ * in f_devdata, a pointer to which gets handed down from devopen().
+ *
+ * Do not expect booting via different methods to have the same
+ * requirements or semantics.
+ *
+ * net_tftp_bootp uses net_mountroot_bootp because that incidentially does
+ * most of what it needs to do. It of course in no manner actually mounts
+ * anything, all that routine actually does is prepare the socket for the
+ * necessary net access, and print info for the user.
+ */
+
int
-net_tftp_bootp(struct of_dev *op)
+net_tftp_bootp(int **sock)
{
net_mountroot_bootp();
if (myip.s_addr == 0)
return(ENOENT);
+ *sock = &netdev_sock;
return (0);
}
diff -r e1d1e1bacabb -r 0fcb1a7845b0 sys/arch/sparc/stand/ofwboot/net.h
--- a/sys/arch/sparc/stand/ofwboot/net.h Sat Jul 21 00:03:19 2012 +0000
+++ b/sys/arch/sparc/stand/ofwboot/net.h Sat Jul 21 00:04:56 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: net.h,v 1.2 2011/05/21 15:50:42 tsutsui Exp $ */
+/* $NetBSD: net.h,v 1.2.14.1 2012/07/21 00:04:56 riz Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
int net_open(struct of_dev *);
int net_close(struct of_dev *);
-int net_tftp_bootp(struct of_dev *);
+int net_tftp_bootp(int **);
int net_mountroot(void);
#endif /* _OFWBOOT_NET_H */
diff -r e1d1e1bacabb -r 0fcb1a7845b0 sys/arch/sparc/stand/ofwboot/ofdev.c
--- a/sys/arch/sparc/stand/ofwboot/ofdev.c Sat Jul 21 00:03:19 2012 +0000
+++ b/sys/arch/sparc/stand/ofwboot/ofdev.c Sat Jul 21 00:04:56 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ofdev.c,v 1.32 2011/06/01 11:42:18 tsutsui Exp $ */
+/* $NetBSD: ofdev.c,v 1.32.10.1 2012/07/21 00:04:56 riz Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -536,7 +536,7 @@
if (!strncmp(*file,"/tftp:",6)) {
*file += 6;
memcpy(&file_system[0], &file_system_tftp, sizeof file_system[0]);
- if (net_tftp_bootp(of->f_devdata)) {
+ if (net_tftp_bootp((int **)&of->f_devdata)) {
net_close(&ofdev);
goto bad;
}
Home |
Main Index |
Thread Index |
Old Index