diff options
| author | Michael Ellerman <michael@ellerman.id.au> | 2005-08-31 21:29:27 -0400 |
|---|---|---|
| committer | Jeff Garzik <jgarzik@pobox.com> | 2005-08-31 22:43:42 -0400 |
| commit | 59f17aebabef709a32a8fc09b4cd3507f32dea01 (patch) | |
| tree | 9bdf374b21bfa92a5fd22e6f9367017b54575054 | |
| parent | 642d1a4c36b9002a45ea6498bda5d1e911eeb933 (diff) | |
[PATCH] iseries_veth: Remove studly caps from iseries_veth.c
Having merged iseries_veth.h, let's remove some of the studly caps that came
with it.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
| -rw-r--r-- | drivers/net/iseries_veth.c | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c index 2e54c85bc099..a3855e94fbc5 100644 --- a/drivers/net/iseries_veth.c +++ b/drivers/net/iseries_veth.c | |||
| @@ -85,26 +85,26 @@ MODULE_AUTHOR("Kyle Lucke <klucke@us.ibm.com>"); | |||
| 85 | MODULE_DESCRIPTION("iSeries Virtual ethernet driver"); | 85 | MODULE_DESCRIPTION("iSeries Virtual ethernet driver"); |
| 86 | MODULE_LICENSE("GPL"); | 86 | MODULE_LICENSE("GPL"); |
| 87 | 87 | ||
| 88 | #define VethEventTypeCap (0) | 88 | #define VETH_EVENT_CAP (0) |
| 89 | #define VethEventTypeFrames (1) | 89 | #define VETH_EVENT_FRAMES (1) |
| 90 | #define VethEventTypeMonitor (2) | 90 | #define VETH_EVENT_MONITOR (2) |
| 91 | #define VethEventTypeFramesAck (3) | 91 | #define VETH_EVENT_FRAMES_ACK (3) |
| 92 | 92 | ||
| 93 | #define VETH_MAX_ACKS_PER_MSG (20) | 93 | #define VETH_MAX_ACKS_PER_MSG (20) |
| 94 | #define VETH_MAX_FRAMES_PER_MSG (6) | 94 | #define VETH_MAX_FRAMES_PER_MSG (6) |
| 95 | 95 | ||
| 96 | struct VethFramesData { | 96 | struct veth_frames_data { |
| 97 | u32 addr[VETH_MAX_FRAMES_PER_MSG]; | 97 | u32 addr[VETH_MAX_FRAMES_PER_MSG]; |
| 98 | u16 len[VETH_MAX_FRAMES_PER_MSG]; | 98 | u16 len[VETH_MAX_FRAMES_PER_MSG]; |
| 99 | u32 eofmask; | 99 | u32 eofmask; |
| 100 | }; | 100 | }; |
| 101 | #define VETH_EOF_SHIFT (32-VETH_MAX_FRAMES_PER_MSG) | 101 | #define VETH_EOF_SHIFT (32-VETH_MAX_FRAMES_PER_MSG) |
| 102 | 102 | ||
| 103 | struct VethFramesAckData { | 103 | struct veth_frames_ack_data { |
| 104 | u16 token[VETH_MAX_ACKS_PER_MSG]; | 104 | u16 token[VETH_MAX_ACKS_PER_MSG]; |
| 105 | }; | 105 | }; |
| 106 | 106 | ||
| 107 | struct VethCapData { | 107 | struct veth_cap_data { |
| 108 | u8 caps_version; | 108 | u8 caps_version; |
| 109 | u8 rsvd1; | 109 | u8 rsvd1; |
| 110 | u16 num_buffers; | 110 | u16 num_buffers; |
| @@ -115,12 +115,12 @@ struct VethCapData { | |||
| 115 | u64 rsvd4[3]; | 115 | u64 rsvd4[3]; |
| 116 | }; | 116 | }; |
| 117 | 117 | ||
| 118 | struct VethLpEvent { | 118 | struct veth_lpevent { |
| 119 | struct HvLpEvent base_event; | 119 | struct HvLpEvent base_event; |
| 120 | union { | 120 | union { |
| 121 | struct VethCapData caps_data; | 121 | struct veth_cap_data caps_data; |
| 122 | struct VethFramesData frames_data; | 122 | struct veth_frames_data frames_data; |
| 123 | struct VethFramesAckData frames_ack_data; | 123 | struct veth_frames_ack_data frames_ack_data; |
| 124 | } u; | 124 | } u; |
| 125 | 125 | ||
| 126 | }; | 126 | }; |
| @@ -153,7 +153,7 @@ struct VethLpEvent { | |||
| 153 | 153 | ||
| 154 | struct veth_msg { | 154 | struct veth_msg { |
| 155 | struct veth_msg *next; | 155 | struct veth_msg *next; |
| 156 | struct VethFramesData data; | 156 | struct veth_frames_data data; |
| 157 | int token; | 157 | int token; |
| 158 | int in_use; | 158 | int in_use; |
| 159 | struct sk_buff *skb; | 159 | struct sk_buff *skb; |
| @@ -165,7 +165,7 @@ struct veth_lpar_connection { | |||
| 165 | struct work_struct statemachine_wq; | 165 | struct work_struct statemachine_wq; |
| 166 | struct veth_msg *msgs; | 166 | struct veth_msg *msgs; |
| 167 | int num_events; | 167 | int num_events; |
| 168 | struct VethCapData local_caps; | 168 | struct veth_cap_data local_caps; |
| 169 | 169 | ||
| 170 | struct kobject kobject; | 170 | struct kobject kobject; |
| 171 | struct timer_list ack_timer; | 171 | struct timer_list ack_timer; |
| @@ -179,12 +179,12 @@ struct veth_lpar_connection { | |||
| 179 | unsigned long state; | 179 | unsigned long state; |
| 180 | HvLpInstanceId src_inst; | 180 | HvLpInstanceId src_inst; |
| 181 | HvLpInstanceId dst_inst; | 181 | HvLpInstanceId dst_inst; |
| 182 | struct VethLpEvent cap_event, cap_ack_event; | 182 | struct veth_lpevent cap_event, cap_ack_event; |
| 183 | u16 pending_acks[VETH_MAX_ACKS_PER_MSG]; | 183 | u16 pending_acks[VETH_MAX_ACKS_PER_MSG]; |
| 184 | u32 num_pending_acks; | 184 | u32 num_pending_acks; |
| 185 | 185 | ||
| 186 | int num_ack_events; | 186 | int num_ack_events; |
| 187 | struct VethCapData remote_caps; | 187 | struct veth_cap_data remote_caps; |
| 188 | u32 ack_timeout; | 188 | u32 ack_timeout; |
| 189 | 189 | ||
| 190 | struct veth_msg *msg_stack_head; | 190 | struct veth_msg *msg_stack_head; |
| @@ -217,7 +217,7 @@ static int veth_start_xmit(struct sk_buff *skb, struct net_device *dev); | |||
| 217 | static void veth_recycle_msg(struct veth_lpar_connection *, struct veth_msg *); | 217 | static void veth_recycle_msg(struct veth_lpar_connection *, struct veth_msg *); |
| 218 | static void veth_wake_queues(struct veth_lpar_connection *cnx); | 218 | static void veth_wake_queues(struct veth_lpar_connection *cnx); |
| 219 | static void veth_stop_queues(struct veth_lpar_connection *cnx); | 219 | static void veth_stop_queues(struct veth_lpar_connection *cnx); |
| 220 | static void veth_receive(struct veth_lpar_connection *, struct VethLpEvent *); | 220 | static void veth_receive(struct veth_lpar_connection *, struct veth_lpevent *); |
| 221 | static void veth_release_connection(struct kobject *kobject); | 221 | static void veth_release_connection(struct kobject *kobject); |
| 222 | static void veth_timed_ack(unsigned long ptr); | 222 | static void veth_timed_ack(unsigned long ptr); |
| 223 | static void veth_timed_reset(unsigned long ptr); | 223 | static void veth_timed_reset(unsigned long ptr); |
| @@ -308,7 +308,7 @@ static int veth_allocate_events(HvLpIndex rlp, int number) | |||
| 308 | struct veth_allocation vc = { COMPLETION_INITIALIZER(vc.c), 0 }; | 308 | struct veth_allocation vc = { COMPLETION_INITIALIZER(vc.c), 0 }; |
| 309 | 309 | ||
| 310 | mf_allocate_lp_events(rlp, HvLpEvent_Type_VirtualLan, | 310 | mf_allocate_lp_events(rlp, HvLpEvent_Type_VirtualLan, |
| 311 | sizeof(struct VethLpEvent), number, | 311 | sizeof(struct veth_lpevent), number, |
| 312 | &veth_complete_allocation, &vc); | 312 | &veth_complete_allocation, &vc); |
| 313 | wait_for_completion(&vc.c); | 313 | wait_for_completion(&vc.c); |
| 314 | 314 | ||
| @@ -456,7 +456,7 @@ static inline void veth_kick_statemachine(struct veth_lpar_connection *cnx) | |||
| 456 | } | 456 | } |
| 457 | 457 | ||
| 458 | static void veth_take_cap(struct veth_lpar_connection *cnx, | 458 | static void veth_take_cap(struct veth_lpar_connection *cnx, |
| 459 | struct VethLpEvent *event) | 459 | struct veth_lpevent *event) |
| 460 | { | 460 | { |
| 461 | unsigned long flags; | 461 | unsigned long flags; |
| 462 | 462 | ||
| @@ -481,7 +481,7 @@ static void veth_take_cap(struct veth_lpar_connection *cnx, | |||
| 481 | } | 481 | } |
| 482 | 482 | ||
| 483 | static void veth_take_cap_ack(struct veth_lpar_connection *cnx, | 483 | static void veth_take_cap_ack(struct veth_lpar_connection *cnx, |
| 484 | struct VethLpEvent *event) | 484 | struct veth_lpevent *event) |
| 485 | { | 485 | { |
| 486 | unsigned long flags; | 486 | unsigned long flags; |
| 487 | 487 | ||
| @@ -499,7 +499,7 @@ static void veth_take_cap_ack(struct veth_lpar_connection *cnx, | |||
| 499 | } | 499 | } |
| 500 | 500 | ||
| 501 | static void veth_take_monitor_ack(struct veth_lpar_connection *cnx, | 501 | static void veth_take_monitor_ack(struct veth_lpar_connection *cnx, |
| 502 | struct VethLpEvent *event) | 502 | struct veth_lpevent *event) |
| 503 | { | 503 | { |
| 504 | unsigned long flags; | 504 | unsigned long flags; |
| 505 | 505 | ||
| @@ -516,7 +516,7 @@ static void veth_take_monitor_ack(struct veth_lpar_connection *cnx, | |||
| 516 | spin_unlock_irqrestore(&cnx->lock, flags); | 516 | spin_unlock_irqrestore(&cnx->lock, flags); |
| 517 | } | 517 | } |
| 518 | 518 | ||
| 519 | static void veth_handle_ack(struct VethLpEvent *event) | 519 | static void veth_handle_ack(struct veth_lpevent *event) |
| 520 | { | 520 | { |
| 521 | HvLpIndex rlp = event->base_event.xTargetLp; | 521 | HvLpIndex rlp = event->base_event.xTargetLp; |
| 522 | struct veth_lpar_connection *cnx = veth_cnx[rlp]; | 522 | struct veth_lpar_connection *cnx = veth_cnx[rlp]; |
| @@ -524,10 +524,10 @@ static void veth_handle_ack(struct VethLpEvent *event) | |||
| 524 | BUG_ON(! cnx); | 524 | BUG_ON(! cnx); |
| 525 | 525 | ||
| 526 | switch (event->base_event.xSubtype) { | 526 | switch (event->base_event.xSubtype) { |
| 527 | case VethEventTypeCap: | 527 | case VETH_EVENT_CAP: |
| 528 | veth_take_cap_ack(cnx, event); | 528 | veth_take_cap_ack(cnx, event); |
| 529 | break; | 529 | break; |
| 530 | case VethEventTypeMonitor: | 530 | case VETH_EVENT_MONITOR: |
| 531 | veth_take_monitor_ack(cnx, event); | 531 | veth_take_monitor_ack(cnx, event); |
| 532 | break; | 532 | break; |
| 533 | default: | 533 | default: |
| @@ -536,7 +536,7 @@ static void veth_handle_ack(struct VethLpEvent *event) | |||
| 536 | }; | 536 | }; |
| 537 | } | 537 | } |
| 538 | 538 | ||
| 539 | static void veth_handle_int(struct VethLpEvent *event) | 539 | static void veth_handle_int(struct veth_lpevent *event) |
| 540 | { | 540 | { |
| 541 | HvLpIndex rlp = event->base_event.xSourceLp; | 541 | HvLpIndex rlp = event->base_event.xSourceLp; |
| 542 | struct veth_lpar_connection *cnx = veth_cnx[rlp]; | 542 | struct veth_lpar_connection *cnx = veth_cnx[rlp]; |
| @@ -546,14 +546,14 @@ static void veth_handle_int(struct VethLpEvent *event) | |||
| 546 | BUG_ON(! cnx); | 546 | BUG_ON(! cnx); |
| 547 | 547 | ||
| 548 | switch (event->base_event.xSubtype) { | 548 | switch (event->base_event.xSubtype) { |
| 549 | case VethEventTypeCap: | 549 | case VETH_EVENT_CAP: |
| 550 | veth_take_cap(cnx, event); | 550 | veth_take_cap(cnx, event); |
| 551 | break; | 551 | break; |
| 552 | case VethEventTypeMonitor: | 552 | case VETH_EVENT_MONITOR: |
| 553 | /* do nothing... this'll hang out here til we're dead, | 553 | /* do nothing... this'll hang out here til we're dead, |
| 554 | * and the hypervisor will return it for us. */ | 554 | * and the hypervisor will return it for us. */ |
| 555 | break; | 555 | break; |
| 556 | case VethEventTypeFramesAck: | 556 | case VETH_EVENT_FRAMES_ACK: |
| 557 | spin_lock_irqsave(&cnx->lock, flags); | 557 | spin_lock_irqsave(&cnx->lock, flags); |
| 558 | 558 | ||
| 559 | for (i = 0; i < VETH_MAX_ACKS_PER_MSG; ++i) { | 559 | for (i = 0; i < VETH_MAX_ACKS_PER_MSG; ++i) { |
| @@ -573,7 +573,7 @@ static void veth_handle_int(struct VethLpEvent *event) | |||
| 573 | 573 | ||
| 574 | spin_unlock_irqrestore(&cnx->lock, flags); | 574 | spin_unlock_irqrestore(&cnx->lock, flags); |
| 575 | break; | 575 | break; |
| 576 | case VethEventTypeFrames: | 576 | case VETH_EVENT_FRAMES: |
| 577 | veth_receive(cnx, event); | 577 | veth_receive(cnx, event); |
| 578 | break; | 578 | break; |
| 579 | default: | 579 | default: |
| @@ -584,7 +584,7 @@ static void veth_handle_int(struct VethLpEvent *event) | |||
| 584 | 584 | ||
| 585 | static void veth_handle_event(struct HvLpEvent *event, struct pt_regs *regs) | 585 | static void veth_handle_event(struct HvLpEvent *event, struct pt_regs *regs) |
| 586 | { | 586 | { |
| 587 | struct VethLpEvent *veth_event = (struct VethLpEvent *)event; | 587 | struct veth_lpevent *veth_event = (struct veth_lpevent *)event; |
| 588 | 588 | ||
| 589 | if (event->xFlags.xFunction == HvLpEvent_Function_Ack) | 589 | if (event->xFlags.xFunction == HvLpEvent_Function_Ack) |
| 590 | veth_handle_ack(veth_event); | 590 | veth_handle_ack(veth_event); |
| @@ -594,7 +594,7 @@ static void veth_handle_event(struct HvLpEvent *event, struct pt_regs *regs) | |||
| 594 | 594 | ||
| 595 | static int veth_process_caps(struct veth_lpar_connection *cnx) | 595 | static int veth_process_caps(struct veth_lpar_connection *cnx) |
| 596 | { | 596 | { |
| 597 | struct VethCapData *remote_caps = &cnx->remote_caps; | 597 | struct veth_cap_data *remote_caps = &cnx->remote_caps; |
| 598 | int num_acks_needed; | 598 | int num_acks_needed; |
| 599 | 599 | ||
| 600 | /* Convert timer to jiffies */ | 600 | /* Convert timer to jiffies */ |
| @@ -710,7 +710,7 @@ static void veth_statemachine(void *p) | |||
| 710 | 710 | ||
| 711 | if ( (cnx->state & VETH_STATE_OPEN) | 711 | if ( (cnx->state & VETH_STATE_OPEN) |
| 712 | && !(cnx->state & VETH_STATE_SENTMON) ) { | 712 | && !(cnx->state & VETH_STATE_SENTMON) ) { |
| 713 | rc = veth_signalevent(cnx, VethEventTypeMonitor, | 713 | rc = veth_signalevent(cnx, VETH_EVENT_MONITOR, |
| 714 | HvLpEvent_AckInd_DoAck, | 714 | HvLpEvent_AckInd_DoAck, |
| 715 | HvLpEvent_AckType_DeferredAck, | 715 | HvLpEvent_AckType_DeferredAck, |
| 716 | 0, 0, 0, 0, 0, 0); | 716 | 0, 0, 0, 0, 0, 0); |
| @@ -733,7 +733,7 @@ static void veth_statemachine(void *p) | |||
| 733 | && !(cnx->state & VETH_STATE_SENTCAPS)) { | 733 | && !(cnx->state & VETH_STATE_SENTCAPS)) { |
| 734 | u64 *rawcap = (u64 *)&cnx->local_caps; | 734 | u64 *rawcap = (u64 *)&cnx->local_caps; |
| 735 | 735 | ||
| 736 | rc = veth_signalevent(cnx, VethEventTypeCap, | 736 | rc = veth_signalevent(cnx, VETH_EVENT_CAP, |
| 737 | HvLpEvent_AckInd_DoAck, | 737 | HvLpEvent_AckInd_DoAck, |
| 738 | HvLpEvent_AckType_ImmediateAck, | 738 | HvLpEvent_AckType_ImmediateAck, |
| 739 | 0, rawcap[0], rawcap[1], rawcap[2], | 739 | 0, rawcap[0], rawcap[1], rawcap[2], |
| @@ -755,7 +755,7 @@ static void veth_statemachine(void *p) | |||
| 755 | 755 | ||
| 756 | if ((cnx->state & VETH_STATE_GOTCAPS) | 756 | if ((cnx->state & VETH_STATE_GOTCAPS) |
| 757 | && !(cnx->state & VETH_STATE_SENTCAPACK)) { | 757 | && !(cnx->state & VETH_STATE_SENTCAPACK)) { |
| 758 | struct VethCapData *remote_caps = &cnx->remote_caps; | 758 | struct veth_cap_data *remote_caps = &cnx->remote_caps; |
| 759 | 759 | ||
| 760 | memcpy(remote_caps, &cnx->cap_event.u.caps_data, | 760 | memcpy(remote_caps, &cnx->cap_event.u.caps_data, |
| 761 | sizeof(*remote_caps)); | 761 | sizeof(*remote_caps)); |
| @@ -1142,7 +1142,7 @@ static int veth_transmit_to_one(struct sk_buff *skb, HvLpIndex rlp, | |||
| 1142 | msg->data.len[0] = skb->len; | 1142 | msg->data.len[0] = skb->len; |
| 1143 | msg->data.eofmask = 1 << VETH_EOF_SHIFT; | 1143 | msg->data.eofmask = 1 << VETH_EOF_SHIFT; |
| 1144 | 1144 | ||
| 1145 | rc = veth_signaldata(cnx, VethEventTypeFrames, msg->token, &msg->data); | 1145 | rc = veth_signaldata(cnx, VETH_EVENT_FRAMES, msg->token, &msg->data); |
| 1146 | 1146 | ||
| 1147 | if (rc != HvLpEvent_Rc_Good) | 1147 | if (rc != HvLpEvent_Rc_Good) |
| 1148 | goto recycle_and_drop; | 1148 | goto recycle_and_drop; |
| @@ -1409,7 +1409,7 @@ static void veth_flush_acks(struct veth_lpar_connection *cnx) | |||
| 1409 | { | 1409 | { |
| 1410 | HvLpEvent_Rc rc; | 1410 | HvLpEvent_Rc rc; |
| 1411 | 1411 | ||
| 1412 | rc = veth_signaldata(cnx, VethEventTypeFramesAck, | 1412 | rc = veth_signaldata(cnx, VETH_EVENT_FRAMES_ACK, |
| 1413 | 0, &cnx->pending_acks); | 1413 | 0, &cnx->pending_acks); |
| 1414 | 1414 | ||
| 1415 | if (rc != HvLpEvent_Rc_Good) | 1415 | if (rc != HvLpEvent_Rc_Good) |
| @@ -1421,9 +1421,9 @@ static void veth_flush_acks(struct veth_lpar_connection *cnx) | |||
| 1421 | } | 1421 | } |
| 1422 | 1422 | ||
| 1423 | static void veth_receive(struct veth_lpar_connection *cnx, | 1423 | static void veth_receive(struct veth_lpar_connection *cnx, |
| 1424 | struct VethLpEvent *event) | 1424 | struct veth_lpevent *event) |
| 1425 | { | 1425 | { |
| 1426 | struct VethFramesData *senddata = &event->u.frames_data; | 1426 | struct veth_frames_data *senddata = &event->u.frames_data; |
| 1427 | int startchunk = 0; | 1427 | int startchunk = 0; |
| 1428 | int nchunks; | 1428 | int nchunks; |
| 1429 | unsigned long flags; | 1429 | unsigned long flags; |
