diff options
author | Mark Einon <mark.einon@gmail.com> | 2011-10-23 05:22:47 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-10-23 05:35:12 -0400 |
commit | 44012dfe4e6113c5c51393e2cd6cd49d8108da96 (patch) | |
tree | 8da0e74b19a82fe2836a10c679442c8147bc0a16 /drivers/staging | |
parent | c018a5f11df2a0464455ba4f1f6eae88e0ef8666 (diff) |
staging: et131x: Remove some forward declarations
Moved functions in et131x.c file to remove the following forward
declarations:
et131x_align_allocated_memory
et131x_disable_interrupts
et131x_enable_interrupts
et131x_error_timer_handler
Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/et131x/et131x.c | 126 |
1 files changed, 60 insertions, 66 deletions
diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c index cf6f7a283aee..8048d676614c 100644 --- a/drivers/staging/et131x/et131x.c +++ b/drivers/staging/et131x/et131x.c | |||
@@ -576,12 +576,6 @@ struct et131x_adapter { | |||
576 | struct net_device_stats net_stats; | 576 | struct net_device_stats net_stats; |
577 | }; | 577 | }; |
578 | 578 | ||
579 | void et131x_error_timer_handler(unsigned long data); | ||
580 | void et131x_enable_interrupts(struct et131x_adapter *adapter); | ||
581 | void et131x_disable_interrupts(struct et131x_adapter *adapter); | ||
582 | void et131x_align_allocated_memory(struct et131x_adapter *adapter, | ||
583 | u64 *phys_addr, | ||
584 | u64 *offset, u64 mask); | ||
585 | void et131x_adapter_setup(struct et131x_adapter *adapter); | 579 | void et131x_adapter_setup(struct et131x_adapter *adapter); |
586 | void et131x_soft_reset(struct et131x_adapter *adapter); | 580 | void et131x_soft_reset(struct et131x_adapter *adapter); |
587 | void et131x_isr_handler(struct work_struct *work); | 581 | void et131x_isr_handler(struct work_struct *work); |
@@ -1872,6 +1866,33 @@ static inline u32 bump_free_buff_ring(u32 *free_buff_ring, u32 limit) | |||
1872 | } | 1866 | } |
1873 | 1867 | ||
1874 | /** | 1868 | /** |
1869 | * et131x_align_allocated_memory - Align allocated memory on a given boundary | ||
1870 | * @adapter: pointer to our adapter structure | ||
1871 | * @phys_addr: pointer to Physical address | ||
1872 | * @offset: pointer to the offset variable | ||
1873 | * @mask: correct mask | ||
1874 | */ | ||
1875 | void et131x_align_allocated_memory(struct et131x_adapter *adapter, | ||
1876 | uint64_t *phys_addr, | ||
1877 | uint64_t *offset, uint64_t mask) | ||
1878 | { | ||
1879 | uint64_t new_addr; | ||
1880 | |||
1881 | *offset = 0; | ||
1882 | |||
1883 | new_addr = *phys_addr & ~mask; | ||
1884 | |||
1885 | if (new_addr != *phys_addr) { | ||
1886 | /* Move to next aligned block */ | ||
1887 | new_addr += mask + 1; | ||
1888 | /* Return offset for adjusting virt addr */ | ||
1889 | *offset = new_addr - *phys_addr; | ||
1890 | /* Return new physical address */ | ||
1891 | *phys_addr = new_addr; | ||
1892 | } | ||
1893 | } | ||
1894 | |||
1895 | /** | ||
1875 | * et131x_rx_dma_memory_alloc | 1896 | * et131x_rx_dma_memory_alloc |
1876 | * @adapter: pointer to our private adapter structure | 1897 | * @adapter: pointer to our private adapter structure |
1877 | * | 1898 | * |
@@ -3938,6 +3959,27 @@ static int et131x_pci_init(struct et131x_adapter *adapter, | |||
3938 | } | 3959 | } |
3939 | 3960 | ||
3940 | /** | 3961 | /** |
3962 | * et131x_enable_interrupts - enable interrupt | ||
3963 | * @adapter: et131x device | ||
3964 | * | ||
3965 | * Enable the appropriate interrupts on the ET131x according to our | ||
3966 | * configuration | ||
3967 | */ | ||
3968 | void et131x_enable_interrupts(struct et131x_adapter *adapter) | ||
3969 | { | ||
3970 | u32 mask; | ||
3971 | |||
3972 | /* Enable all global interrupts */ | ||
3973 | if (adapter->flowcontrol == FLOW_TXONLY || | ||
3974 | adapter->flowcontrol == FLOW_BOTH) | ||
3975 | mask = INT_MASK_ENABLE; | ||
3976 | else | ||
3977 | mask = INT_MASK_ENABLE_NO_FLOW; | ||
3978 | |||
3979 | writel(mask, &adapter->regs->global.int_mask); | ||
3980 | } | ||
3981 | |||
3982 | /** | ||
3941 | * et131x_error_timer_handler | 3983 | * et131x_error_timer_handler |
3942 | * @data: timer-specific variable; here a pointer to our adapter structure | 3984 | * @data: timer-specific variable; here a pointer to our adapter structure |
3943 | * | 3985 | * |
@@ -4071,33 +4113,6 @@ void et131x_soft_reset(struct et131x_adapter *adapter) | |||
4071 | } | 4113 | } |
4072 | 4114 | ||
4073 | /** | 4115 | /** |
4074 | * et131x_align_allocated_memory - Align allocated memory on a given boundary | ||
4075 | * @adapter: pointer to our adapter structure | ||
4076 | * @phys_addr: pointer to Physical address | ||
4077 | * @offset: pointer to the offset variable | ||
4078 | * @mask: correct mask | ||
4079 | */ | ||
4080 | void et131x_align_allocated_memory(struct et131x_adapter *adapter, | ||
4081 | uint64_t *phys_addr, | ||
4082 | uint64_t *offset, uint64_t mask) | ||
4083 | { | ||
4084 | uint64_t new_addr; | ||
4085 | |||
4086 | *offset = 0; | ||
4087 | |||
4088 | new_addr = *phys_addr & ~mask; | ||
4089 | |||
4090 | if (new_addr != *phys_addr) { | ||
4091 | /* Move to next aligned block */ | ||
4092 | new_addr += mask + 1; | ||
4093 | /* Return offset for adjusting virt addr */ | ||
4094 | *offset = new_addr - *phys_addr; | ||
4095 | /* Return new physical address */ | ||
4096 | *phys_addr = new_addr; | ||
4097 | } | ||
4098 | } | ||
4099 | |||
4100 | /** | ||
4101 | * et131x_adapter_memory_alloc | 4116 | * et131x_adapter_memory_alloc |
4102 | * @adapter: pointer to our private adapter structure | 4117 | * @adapter: pointer to our private adapter structure |
4103 | * | 4118 | * |
@@ -4339,6 +4354,18 @@ static struct et131x_adapter *et131x_adapter_init(struct net_device *netdev, | |||
4339 | } | 4354 | } |
4340 | 4355 | ||
4341 | /** | 4356 | /** |
4357 | * et131x_disable_interrupts - interrupt disable | ||
4358 | * @adapter: et131x device | ||
4359 | * | ||
4360 | * Block all interrupts from the et131x device at the device itself | ||
4361 | */ | ||
4362 | void et131x_disable_interrupts(struct et131x_adapter *adapter) | ||
4363 | { | ||
4364 | /* Disable all global interrupts */ | ||
4365 | writel(INT_MASK_DISABLE, &adapter->regs->global.int_mask); | ||
4366 | } | ||
4367 | |||
4368 | /** | ||
4342 | * et131x_pci_setup - Perform device initialization | 4369 | * et131x_pci_setup - Perform device initialization |
4343 | * @pdev: a pointer to the device's pci_dev structure | 4370 | * @pdev: a pointer to the device's pci_dev structure |
4344 | * @ent: this device's entry in the pci_device_id table | 4371 | * @ent: this device's entry in the pci_device_id table |
@@ -4633,39 +4660,6 @@ module_exit(et131x_cleanup_module); | |||
4633 | /* ISR functions */ | 4660 | /* ISR functions */ |
4634 | 4661 | ||
4635 | /** | 4662 | /** |
4636 | * et131x_enable_interrupts - enable interrupt | ||
4637 | * @adapter: et131x device | ||
4638 | * | ||
4639 | * Enable the appropriate interrupts on the ET131x according to our | ||
4640 | * configuration | ||
4641 | */ | ||
4642 | void et131x_enable_interrupts(struct et131x_adapter *adapter) | ||
4643 | { | ||
4644 | u32 mask; | ||
4645 | |||
4646 | /* Enable all global interrupts */ | ||
4647 | if (adapter->flowcontrol == FLOW_TXONLY || | ||
4648 | adapter->flowcontrol == FLOW_BOTH) | ||
4649 | mask = INT_MASK_ENABLE; | ||
4650 | else | ||
4651 | mask = INT_MASK_ENABLE_NO_FLOW; | ||
4652 | |||
4653 | writel(mask, &adapter->regs->global.int_mask); | ||
4654 | } | ||
4655 | |||
4656 | /** | ||
4657 | * et131x_disable_interrupts - interrupt disable | ||
4658 | * @adapter: et131x device | ||
4659 | * | ||
4660 | * Block all interrupts from the et131x device at the device itself | ||
4661 | */ | ||
4662 | void et131x_disable_interrupts(struct et131x_adapter *adapter) | ||
4663 | { | ||
4664 | /* Disable all global interrupts */ | ||
4665 | writel(INT_MASK_DISABLE, &adapter->regs->global.int_mask); | ||
4666 | } | ||
4667 | |||
4668 | /** | ||
4669 | * et131x_isr - The Interrupt Service Routine for the driver. | 4663 | * et131x_isr - The Interrupt Service Routine for the driver. |
4670 | * @irq: the IRQ on which the interrupt was received. | 4664 | * @irq: the IRQ on which the interrupt was received. |
4671 | * @dev_id: device-specific info (here a pointer to a net_device struct) | 4665 | * @dev_id: device-specific info (here a pointer to a net_device struct) |