aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2013-11-10 07:05:49 -0500
committerChris Zankel <chris@zankel.net>2014-01-14 13:19:51 -0500
commit35e14b443aa906ffb4ff8bd884e393c1bbdb6670 (patch)
tree0fb0f287623fcadf5abe4e3097526954c54d16c4 /arch/xtensa
parentf6ac5a177db24379e7a7a7d44b1ae7d1036042ec (diff)
xtensa: ISS: always use fixed tuntap config
The code doesn't handle dynamic TAP interface allocation, so there's no point tracking this case. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Chris Zankel <chris@zankel.net>
Diffstat (limited to 'arch/xtensa')
-rw-r--r--arch/xtensa/platforms/iss/network.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/arch/xtensa/platforms/iss/network.c b/arch/xtensa/platforms/iss/network.c
index b33ed0c53547..668ed624b2c2 100644
--- a/arch/xtensa/platforms/iss/network.c
+++ b/arch/xtensa/platforms/iss/network.c
@@ -56,7 +56,6 @@ static LIST_HEAD(devices);
56 56
57struct tuntap_info { 57struct tuntap_info {
58 char dev_name[IFNAMSIZ]; 58 char dev_name[IFNAMSIZ];
59 int fixed_config;
60 int fd; 59 int fd;
61}; 60};
62 61
@@ -164,11 +163,6 @@ static int tuntap_open(struct iss_net_private *lp)
164 int err = -EINVAL; 163 int err = -EINVAL;
165 int fd; 164 int fd;
166 165
167 /* We currently only support a fixed configuration. */
168
169 if (!lp->tp.info.tuntap.fixed_config)
170 return -EINVAL;
171
172 fd = simc_open("/dev/net/tun", 02, 0); /* O_RDWR */ 166 fd = simc_open("/dev/net/tun", 02, 0); /* O_RDWR */
173 if (fd < 0) { 167 if (fd < 0) {
174 pr_err("Failed to open /dev/net/tun, returned %d (errno = %d)\n", 168 pr_err("Failed to open /dev/net/tun, returned %d (errno = %d)\n",
@@ -220,8 +214,7 @@ static int tuntap_poll(struct iss_net_private *lp)
220} 214}
221 215
222/* 216/*
223 * Currently only a device name is supported. 217 * ethX=tuntap,[mac address],device name
224 * ethX=tuntap[,[mac address][,[device name]]]
225 */ 218 */
226 219
227static int tuntap_probe(struct iss_net_private *lp, int index, char *init) 220static int tuntap_probe(struct iss_net_private *lp, int index, char *init)
@@ -247,12 +240,13 @@ static int tuntap_probe(struct iss_net_private *lp, int index, char *init)
247 return 0; 240 return 0;
248 } 241 }
249 242
250 if (dev_name) { 243 if (!dev_name) {
251 strlcpy(lp->tp.info.tuntap.dev_name, dev_name, 244 pr_err("%s: missing tuntap device name\n", dev->name);
252 sizeof(lp->tp.info.tuntap.dev_name)); 245 return 0;
253 lp->tp.info.tuntap.fixed_config = 1; 246 }
254 } else 247
255 strcpy(lp->tp.info.tuntap.dev_name, TRANSPORT_TUNTAP_NAME); 248 strlcpy(lp->tp.info.tuntap.dev_name, dev_name,
249 sizeof(lp->tp.info.tuntap.dev_name));
256 250
257 setup_etheraddr(dev, mac_str); 251 setup_etheraddr(dev, mac_str);
258 252