Wall-Pinning Model of Magnetic Hysteresis