Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 5714
b: refs/heads/master
c: 66aea23
h: refs/heads/master
v: v3
  • Loading branch information
Cornelia Huck authored and Linus Torvalds committed Aug 8, 2005
1 parent 1c4eacc commit 296b529
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 69 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8b83bc77bf77cc8459cb94e52b08e775104c4c48
refs/heads/master: 66aea23ff84ca81bfaeaf7d63e248b873f5c2616
24 changes: 13 additions & 11 deletions trunk/drivers/s390/net/qeth_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8120,20 +8120,22 @@ static struct notifier_block qeth_ip6_notifier = {
#endif

static int
qeth_reboot_event(struct notifier_block *this, unsigned long event, void *ptr)
__qeth_reboot_event_card(struct device *dev, void *data)
{

struct device *entry;
struct qeth_card *card;

down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem);
list_for_each_entry(entry, &qeth_ccwgroup_driver.driver.devices,
driver_list) {
card = (struct qeth_card *) entry->driver_data;
qeth_clear_ip_list(card, 0, 0);
qeth_qdio_clear_card(card, 0);
}
up_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem);
card = (struct qeth_card *) dev->driver_data;
qeth_clear_ip_list(card, 0, 0);
qeth_qdio_clear_card(card, 0);
return 0;
}

static int
qeth_reboot_event(struct notifier_block *this, unsigned long event, void *ptr)
{

driver_for_each_device(&qeth_ccwgroup_driver.driver, NULL, NULL,
__qeth_reboot_event_card);
return NOTIFY_DONE;
}

Expand Down
126 changes: 69 additions & 57 deletions trunk/drivers/s390/net/qeth_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,33 @@ const char *VERSION_QETH_PROC_C = "$Revision: 1.13 $";
#define QETH_PROCFILE_NAME "qeth"
static struct proc_dir_entry *qeth_procfile;

static int
qeth_procfile_seq_match(struct device *dev, void *data)
{
return 1;
}

static void *
qeth_procfile_seq_start(struct seq_file *s, loff_t *offset)
{
struct list_head *next_card = NULL;
int i = 0;
struct device *dev;
loff_t nr;

down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem);

if (*offset == 0)
nr = *offset;
if (nr == 0)
return SEQ_START_TOKEN;

/* get card at pos *offset */
list_for_each(next_card, &qeth_ccwgroup_driver.driver.devices)
if (++i == *offset)
return next_card;
dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL,
NULL, qeth_procfile_seq_match);

return NULL;
/* get card at pos *offset */
nr = *offset;
while (nr-- > 1 && dev)
dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev,
NULL, qeth_procfile_seq_match);
return (void *) dev;
}

static void
Expand All @@ -55,23 +65,21 @@ qeth_procfile_seq_stop(struct seq_file *s, void* it)
static void *
qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset)
{
struct list_head *next_card = NULL;
struct list_head *current_card;
struct device *prev, *next;

if (it == SEQ_START_TOKEN) {
next_card = qeth_ccwgroup_driver.driver.devices.next;
if (next_card->next == next_card) /* list empty */
return NULL;
(*offset)++;
} else {
current_card = (struct list_head *)it;
if (current_card->next == &qeth_ccwgroup_driver.driver.devices)
return NULL; /* end of list reached */
next_card = current_card->next;
(*offset)++;
next = driver_find_device(&qeth_ccwgroup_driver.driver,
NULL, NULL, qeth_procfile_seq_match);
if (next)
(*offset)++;
return (void *) next;
}

return next_card;
prev = (struct device *) it;
next = driver_find_device(&qeth_ccwgroup_driver.driver,
prev, NULL, qeth_procfile_seq_match);
if (next)
(*offset)++;
return (void *) next;
}

static inline const char *
Expand Down Expand Up @@ -126,7 +134,7 @@ qeth_procfile_seq_show(struct seq_file *s, void *it)
"-------------- ---- ------ ---------- ---- "
"---- ----- -----\n");
} else {
device = list_entry(it, struct device, driver_list);
device = (struct device *) it;
card = device->driver_data;
seq_printf(s, "%s/%s/%s x%02X %-10s %-14s %-4i ",
CARD_RDEV_ID(card),
Expand Down Expand Up @@ -180,17 +188,20 @@ static struct proc_dir_entry *qeth_perf_procfile;
static void *
qeth_perf_procfile_seq_start(struct seq_file *s, loff_t *offset)
{
struct list_head *next_card = NULL;
int i = 0;
struct device *dev = NULL;
int nr;

down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem);
/* get card at pos *offset */
list_for_each(next_card, &qeth_ccwgroup_driver.driver.devices){
if (i == *offset)
return next_card;
i++;
}
return NULL;
dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, NULL,
qeth_procfile_seq_match);

/* get card at pos *offset */
nr = *offset;
while (nr-- > 1 && dev)
dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev,
NULL, qeth_procfile_seq_match);
return (void *) dev;
}

static void
Expand All @@ -202,12 +213,14 @@ qeth_perf_procfile_seq_stop(struct seq_file *s, void* it)
static void *
qeth_perf_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset)
{
struct list_head *current_card = (struct list_head *)it;
struct device *prev, *next;

if (current_card->next == &qeth_ccwgroup_driver.driver.devices)
return NULL; /* end of list reached */
(*offset)++;
return current_card->next;
prev = (struct device *) it;
next = driver_find_device(&qeth_ccwgroup_driver.driver, prev,
NULL, qeth_procfile_seq_match);
if (next)
(*offset)++;
return (void *) next;
}

static int
Expand All @@ -216,7 +229,7 @@ qeth_perf_procfile_seq_show(struct seq_file *s, void *it)
struct device *device;
struct qeth_card *card;

device = list_entry(it, struct device, driver_list);
device = (struct device *) it;
card = device->driver_data;
seq_printf(s, "For card with devnos %s/%s/%s (%s):\n",
CARD_RDEV_ID(card),
Expand Down Expand Up @@ -318,8 +331,8 @@ static struct proc_dir_entry *qeth_ipato_procfile;
static void *
qeth_ipato_procfile_seq_start(struct seq_file *s, loff_t *offset)
{
struct list_head *next_card = NULL;
int i = 0;
struct device *dev;
loff_t nr;

down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem);
/* TODO: finish this */
Expand All @@ -328,13 +341,16 @@ qeth_ipato_procfile_seq_start(struct seq_file *s, loff_t *offset)
* output driver settings then;
* else output setting for respective card
*/

dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, NULL,
qeth_procfile_seq_match);

/* get card at pos *offset */
list_for_each(next_card, &qeth_ccwgroup_driver.driver.devices){
if (i == *offset)
return next_card;
i++;
}
return NULL;
nr = *offset;
while (nr-- > 1 && dev)
dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev,
NULL, qeth_procfile_seq_match);
return (void *) dev;
}

static void
Expand All @@ -346,18 +362,14 @@ qeth_ipato_procfile_seq_stop(struct seq_file *s, void* it)
static void *
qeth_ipato_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset)
{
struct list_head *current_card = (struct list_head *)it;
struct device *prev, *next;

/* TODO: finish this */
/*
* maybe SEQ_SATRT_TOKEN can be returned for offset 0
* output driver settings then;
* else output setting for respective card
*/
if (current_card->next == &qeth_ccwgroup_driver.driver.devices)
return NULL; /* end of list reached */
(*offset)++;
return current_card->next;
prev = (struct device *) it;
next = driver_find_device(&qeth_ccwgroup_driver.driver, prev,
NULL, qeth_procfile_seq_match);
if (next)
(*offset)++;
return (void *) next;
}

static int
Expand All @@ -372,7 +384,7 @@ qeth_ipato_procfile_seq_show(struct seq_file *s, void *it)
* output driver settings then;
* else output setting for respective card
*/
device = list_entry(it, struct device, driver_list);
device = (struct device *) it;
card = device->driver_data;

return 0;
Expand Down

0 comments on commit 296b529

Please sign in to comment.